All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] firestream: Fix memleak in fs_open
@ 2020-08-23 11:29 Dinghao Liu
  2020-08-25  1:03 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dinghao Liu @ 2020-08-23 11:29 UTC (permalink / raw)
  To: dinghao.liu, kjlu; +Cc: Chas Williams, linux-atm-general, netdev, linux-kernel

When make_rate() fails, vcc should be freed just
like other error paths in fs_open().

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/atm/firestream.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index 2ca9ec802734..510250cf5c87 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -998,6 +998,7 @@ static int fs_open(struct atm_vcc *atm_vcc)
 				error = make_rate (pcr, r, &tmc0, NULL);
 				if (error) {
 					kfree(tc);
+					kfree(vcc);
 					return error;
 				}
 			}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] firestream: Fix memleak in fs_open
  2020-08-23 11:29 [PATCH] firestream: Fix memleak in fs_open Dinghao Liu
@ 2020-08-25  1:03 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-08-25  1:03 UTC (permalink / raw)
  To: dinghao.liu; +Cc: kjlu, 3chas3, linux-atm-general, netdev, linux-kernel

From: Dinghao Liu <dinghao.liu@zju.edu.cn>
Date: Sun, 23 Aug 2020 19:29:35 +0800

> When make_rate() fails, vcc should be freed just
> like other error paths in fs_open().
> 
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>

Applied, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-25  1:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-23 11:29 [PATCH] firestream: Fix memleak in fs_open Dinghao Liu
2020-08-25  1:03 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.