Skip to content

Commit

Permalink
V4L/DVB (13961): em28xx-dvb: fix memleak in dvb_fini()
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Francesco Lavra <francescolavra@interfree.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Francesco Lavra authored and Mauro Carvalho Chehab committed Feb 26, 2010
1 parent be39515 commit 19f48cb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/media/video/em28xx/em28xx-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ static int dvb_fini(struct em28xx *dev)

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

Expand Down

0 comments on commit 19f48cb

Please sign in to comment.