+ drivers-media-video-cpia2-cpia2_usbc-free.patch added to -mm tree

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

 



The patch titled
     drivers/media/video/cpia2/cpia2_usb.c: fix error-path leak
has been added to the -mm tree.  Its filename is
     drivers-media-video-cpia2-cpia2_usbc-free.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: drivers/media/video/cpia2/cpia2_usb.c: fix error-path leak
From: Amit Choudhary <amit2030@xxxxxxxxx>

Free previously allocated memory (in array elements) if kmalloc() returns
NULL in submit_urbs().

Signed-off-by: Amit Choudhary <amit2030@xxxxxxxxx>
Cc: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/media/video/cpia2/cpia2_usb.c |    4 ++++
 1 files changed, 4 insertions(+)

diff -puN drivers/media/video/cpia2/cpia2_usb.c~drivers-media-video-cpia2-cpia2_usbc-free drivers/media/video/cpia2/cpia2_usb.c
--- a/drivers/media/video/cpia2/cpia2_usb.c~drivers-media-video-cpia2-cpia2_usbc-free
+++ a/drivers/media/video/cpia2/cpia2_usb.c
@@ -640,6 +640,10 @@ static int submit_urbs(struct camera_dat
 		cam->sbuf[i].data =
 		    kmalloc(FRAMES_PER_DESC * FRAME_SIZE_PER_DESC, GFP_KERNEL);
 		if (!cam->sbuf[i].data) {
+			while (--i >= 0) {
+				kfree(cam->sbuf[i].data);
+				cam->sbuf[i].data = NULL;
+			}
 			return -ENOMEM;
 		}
 	}
_

Patches currently in -mm which might be from amit2030@xxxxxxxxx are

git-dvb.patch
drivers-media-video-cpia2-cpia2_usbc-free.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux