From: Francesco Lavra <francescolavra@interfree.it>
To: linux-media@vger.kernel.org
Subject: [PATCH] em28xx-dvb: fix memleak in dvb_fini()
Date: Thu, 31 Dec 2009 12:47:11 +0100 [thread overview]
Message-ID: <1262260031.4401.9.camel@localhost> (raw)
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
Signed-off-by: Francesco Lavra <francescolavra@interfree.it>
--- a/linux/drivers/media/video/em28xx/em28xx-dvb.c 2009-12-31 12:23:53.000000000 +0100
+++ b/linux/drivers/media/video/em28xx/em28xx-dvb.c 2009-12-31 12:23:56.000000000 +0100
@@ -607,6 +607,7 @@ static int dvb_fini(struct em28xx *dev)
if (dev->dvb) {
unregister_dvb(dev->dvb);
+ kfree(dev->dvb);
dev->dvb = NULL;
}
next reply other threads:[~2009-12-31 11:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-31 11:47 Francesco Lavra [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-02-13 11:02 [PATCH] em28xx-dvb: fix memleak in dvb_fini() Francesco Lavra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1262260031.4401.9.camel@localhost \
--to=francescolavra@interfree.it \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.