linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-media@vger.kernel.org, Hans Verkuil <hverkuil@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 2/2] [media] vicam: Return directly after a failed kmalloc() in vicam_dostream()
Date: Mon, 18 Sep 2017 22:12:26 +0200	[thread overview]
Message-ID: <a03c7497-3c98-7ba9-368e-7e1f5296144b@users.sourceforge.net> (raw)
In-Reply-To: <78839a2c-2076-f480-79d3-e783d2f8c0bf@users.sourceforge.net>

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

      parent reply	other threads:[~2017-09-18 20:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-18 20:10 [PATCH 0/2] [media] ViCam: Adjustments for vicam_dostream() SF Markus Elfring
2017-09-18 20:11 ` [PATCH 1/2] [media] vicam: Delete an error message for a failed memory allocation in vicam_dostream() SF Markus Elfring
2017-09-18 20:12 ` SF Markus Elfring [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a03c7497-3c98-7ba9-368e-7e1f5296144b@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=hverkuil@xs4all.nl \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).