diff mbox

[2/2,media] vicam: Return directly after a failed kmalloc() in vicam_dostream()

Message ID a03c7497-3c98-7ba9-368e-7e1f5296144b@users.sourceforge.net (mailing list archive)
State New, archived
Headers show

Commit Message

SF Markus Elfring Sept. 18, 2017, 8:12 p.m. UTC
From: Markus Elfring <elfring@users.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@users.sourceforge.net>
---
 drivers/media/usb/gspca/vicam.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

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