[PATCH 1/1] EM28xx - Fix memory leak on disconnect or error.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>

Cheers,
Chris
--- 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;
 		}

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux