[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1559047093-24235-1-git-send-email-92siuyang@gmail.com>
Date: Tue, 28 May 2019 20:38:13 +0800
From: Young Xiao <92siuyang@...il.com>
To: mchehab@...nel.org, linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Young Xiao <92siuyang@...il.com>
Subject: [PATCH] cx231xx-dvb: fix memory leak in dvb_fini()
In dvb_init(), dev->dvb is allocated by kzalloc.
Therefore, it must be freed being set to NULL.
Signed-off-by: Young Xiao <92siuyang@...il.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
Powered by blists - more mailing lists