[PATCH] cx231xx-dvb: fix memory leak in dvb_fini()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In dvb_init(), dev->dvb is allocated by kzalloc.
Therefore, it must be freed being set to NULL.

Signed-off-by: Young Xiao <92siuyang@xxxxxxxxx>
---
 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




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux