All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] EM28xx - Fix memory leak on disconnect or error.
@ 2011-09-04 19:38 Chris Rankin
  0 siblings, 0 replies; only message in thread
From: Chris Rankin @ 2011-09-04 19:38 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-media

[-- 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;
 		}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-04 19:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-04 19:38 [PATCH 1/1] EM28xx - Fix memory leak on disconnect or error Chris Rankin

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.