diff options
-rw-r--r-- | drivers/media/video/cpia2/cpia2_usb.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/video/cpia2/cpia2_usb.c b/drivers/media/video/cpia2/cpia2_usb.c index 28dc6a1a1e43..d8e929863a88 100644 --- a/drivers/media/video/cpia2/cpia2_usb.c +++ b/drivers/media/video/cpia2/cpia2_usb.c | |||
@@ -640,6 +640,10 @@ static int submit_urbs(struct camera_data *cam) | |||
640 | cam->sbuf[i].data = | 640 | cam->sbuf[i].data = |
641 | kmalloc(FRAMES_PER_DESC * FRAME_SIZE_PER_DESC, GFP_KERNEL); | 641 | kmalloc(FRAMES_PER_DESC * FRAME_SIZE_PER_DESC, GFP_KERNEL); |
642 | if (!cam->sbuf[i].data) { | 642 | if (!cam->sbuf[i].data) { |
643 | while (--i >= 0) { | ||
644 | kfree(cam->sbuf[i].data); | ||
645 | cam->sbuf[i].data = NULL; | ||
646 | } | ||
643 | return -ENOMEM; | 647 | return -ENOMEM; |
644 | } | 648 | } |
645 | } | 649 | } |