* [PATCH] cx231xx-dvb: fix memory leak in dvb_fini()
@ 2019-05-28 12:38 Young Xiao
0 siblings, 0 replies; only message in thread
From: Young Xiao @ 2019-05-28 12:38 UTC (permalink / raw)
To: mchehab, linux-media, linux-kernel; +Cc: Young Xiao
In dvb_init(), dev->dvb is allocated by kzalloc.
Therefore, it must be freed being set to NULL.
Signed-off-by: Young Xiao <92siuyang@gmail.com>
---
drivers/media/usb/cx231xx/cx231xx-dvb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c b/drivers/media/usb/cx231xx/cx231xx-dvb.c
index 89357cb..89839c7 100644
--- a/drivers/media/usb/cx231xx/cx231xx-dvb.c
+++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c
@@ -1159,6 +1159,7 @@ static int dvb_fini(struct cx231xx *dev)
if (dev->dvb) {
unregister_dvb(dev->dvb);
+ kfree(dev->dvb);
dev->dvb = NULL;
}
--
2.7.4
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-05-28 12:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-28 12:38 [PATCH] cx231xx-dvb: fix memory leak in dvb_fini() Young Xiao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®