[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a03c7497-3c98-7ba9-368e-7e1f5296144b@users.sourceforge.net>
Date: Mon, 18 Sep 2017 22:12:26 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-media@...r.kernel.org, Hans Verkuil <hverkuil@...all.nl>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Sakari Ailus <sakari.ailus@...ux.intel.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 2/2] [media] vicam: Return directly after a failed kmalloc()
in vicam_dostream()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Mon, 18 Sep 2017 21:56:55 +0200
* Return directly after a call of the function "kmalloc" failed
at the beginning.
* Delete the jump target "exit" which became unnecessary
with this refactoring.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/media/usb/gspca/vicam.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/usb/gspca/vicam.c b/drivers/media/usb/gspca/vicam.c
index 15b6887a8e97..11508ab283cd 100644
--- a/drivers/media/usb/gspca/vicam.c
+++ b/drivers/media/usb/gspca/vicam.c
@@ -184,7 +184,7 @@ static void vicam_dostream(struct work_struct *work)
HEADER_SIZE;
buffer = kmalloc(frame_sz, GFP_KERNEL | GFP_DMA);
if (!buffer)
- goto exit;
+ return;
while (gspca_dev->present && gspca_dev->streaming) {
#ifdef CONFIG_PM
@@ -205,7 +205,7 @@ static void vicam_dostream(struct work_struct *work)
frame_sz - HEADER_SIZE);
gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
}
-exit:
+
kfree(buffer);
}
--
2.14.1
Powered by blists - more mailing lists