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.

Signed-off-by: Francesco Lavra <francescola...@interfree.it>
Cc: stable <sta...@kernel.org>

---

NOTE: this patch has already reached linux-next, but has not been
requested to be pulled for 2.6.33, as it should.

--- a/drivers/media/video/em28xx/em28xx-dvb.c   2009-12-31 12:23:53.000000000 
+0100
+++ b/drivers/media/video/em28xx/em28xx-dvb.c   2009-12-31 12:23:56.000000000 
+0100
@@ -606,6 +606,7 @@ static int dvb_fini(struct em28xx *dev)

        if (dev->dvb) {
                unregister_dvb(dev->dvb);
+               kfree(dev->dvb);
                dev->dvb = NULL;
        }
 


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to