Skip to contentSkip to conversation

em28xx-dvb: fix memleak in dvb_fini()

PATCH New Francesco Lavra 1 participant 1 message Dec 31, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 em28xx-dvb: fix memleak in dvb_fini()

Hi,
this patch fixes a memory leak which occurs when an em28xx card with DVB extension is unplugged or its DVB extension driver is unloaded. In dvb_fini(), dev->dvb must be freed before being set to NULL, as is done in dvb_init() in case of error.
Note that this bug is also present in the latest stable kernel release. Regards,
Francesco

linux/drivers/media/video/em28xx/em28xx-dvb.c +1 -0
@@ -607,6 +607,7 @@ static int dvb_fini(struct em28xx *dev)
 
 	if (dev->dvb) {
 		unregister_dvb(dev->dvb);
+		kfree(dev->dvb);
 		dev->dvb = NULL;
 	}