public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Francesco Lavra <francescolavra@interfree.it>
To: linux-media@vger.kernel.org
Subject: [PATCH] em28xx-dvb: fix memleak in dvb_fini()
Date: Sat, 13 Feb 2010 12:02:45 +0100	[thread overview]
Message-ID: <1266058965.3974.23.camel@localhost> (raw)

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 <francescolavra@interfree.it>
Cc: stable <stable@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;
 	}
 



             reply	other threads:[~2010-02-13 11:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-13 11:02 Francesco Lavra [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-12-31 11:47 [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=1266058965.3974.23.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox