Skip to contentSkip to conversation

cx231xx-dvb: fix memory leak in dvb_fini()

PATCH New Young Xiao 1 participant 1 message May 28, 2019 Media (V4L/DVB)

lore
Share & tools
lore

Young Xiao

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/media/usb/cx231xx/cx231xx-dvb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/usb/cx231xx/cx231xx-dvb.c +1 -0
index 89357cb..89839c7 100644
@@ -1159,6 +1159,7 @@ static int dvb_fini(struct cx231xx *dev)
 
 	if (dev->dvb) {
 		unregister_dvb(dev->dvb);
+		kfree(dev->dvb);
 		dev->dvb = NULL;
 	}
 
Signature · 1 line
2.7.4