public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Rankin <rankincj@yahoo.com>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: linux-media@vger.kernel.org
Subject: [PATCH 1/1] EM28xx - Fix memory leak on disconnect or error.
Date: Sun, 04 Sep 2011 20:38:14 +0100	[thread overview]
Message-ID: <4E63D3A6.3010505@yahoo.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 188 bytes --]

Mauro,

This patch seems to have been missed, so I'm resending it.

Release the dev->alt_max_pkt_size buffer in all cases.

Signed-off-by: Chris Rankin <rankincj@yahoo.com>

Cheers,
Chris

[-- Attachment #2: EM28xx-video-leak.diff --]
[-- Type: text/x-patch, Size: 753 bytes --]

--- linux/drivers/media/video/em28xx/em28xx-cards.c.orig	2011-09-04 20:30:14.000000000 +0100
+++ linux/drivers/media/video/em28xx/em28xx-cards.c	2011-09-04 20:28:59.000000000 +0100
@@ -3200,6 +3200,7 @@
 	retval = em28xx_init_dev(&dev, udev, interface, nr);
 	if (retval) {
 		mutex_unlock(&dev->lock);
+		kfree(dev->alt_max_pkt_size);
 		kfree(dev);
 		goto err;
 	}
--- linux/drivers/media/video/em28xx/em28xx-video.c.orig	2011-09-04 20:16:52.000000000 +0100
+++ linux/drivers/media/video/em28xx/em28xx-video.c	2011-09-04 20:27:41.000000000 +0100
@@ -2200,6 +2200,7 @@
 		   free the remaining resources */
 		if (dev->state & DEV_DISCONNECTED) {
 			em28xx_release_resources(dev);
+			kfree(dev->alt_max_pkt_size);
 			kfree(dev);
 			return 0;
 		}

                 reply	other threads:[~2011-09-04 19:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4E63D3A6.3010505@yahoo.com \
    --to=rankincj@yahoo.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    /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