All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
To: linux-media@vger.kernel.org
Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Hans de Goede <hdegoede@redhat.com>
Subject: [PATCH 3/9] staging: media: atomisp: improve unwinding
Date: Fri,  6 Oct 2023 12:08:44 +0200	[thread overview]
Message-ID: <97bf2e6dcba166ba77a9c35e3fe7b0f20a0abf7a.1696586632.git.hverkuil-cisco@xs4all.nl> (raw)
In-Reply-To: <cover.1696586632.git.hverkuil-cisco@xs4all.nl>

This fixes two smatch warnings:

drivers/staging/media/atomisp/pci/atomisp_cmd.c:2779 atomisp_cp_dvs_6axis_config() warn: missing unwind goto?
drivers/staging/media/atomisp/pci/atomisp_cmd.c:2878 atomisp_cp_morph_table() warn: missing unwind goto?

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
CC: Hans de Goede <hdegoede@redhat.com>
---
 .../staging/media/atomisp/pci/atomisp_cmd.c    | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c
index a54be2d20c58..759233a7ba50 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c
@@ -2771,12 +2771,16 @@ int atomisp_cp_dvs_6axis_config(struct atomisp_sub_device *asd,
 			css_param->dvs_6axis = NULL;
 
 			dvs_6axis_config = ia_css_dvs2_6axis_config_allocate(stream);
-			if (!dvs_6axis_config)
-				return -ENOMEM;
+			if (!dvs_6axis_config) {
+				ret = -ENOMEM;
+				goto error;
+			}
 		} else if (!dvs_6axis_config) {
 			dvs_6axis_config = ia_css_dvs2_6axis_config_allocate(stream);
-			if (!dvs_6axis_config)
-				return -ENOMEM;
+			if (!dvs_6axis_config) {
+				ret = -ENOMEM;
+				goto error;
+			}
 		}
 
 		dvs_6axis_config->exp_id = source_6axis_config->exp_id;
@@ -2874,8 +2878,10 @@ int atomisp_cp_morph_table(struct atomisp_sub_device *asd,
 		morph_table = atomisp_css_morph_table_allocate(
 				source_morph_table->width,
 				source_morph_table->height);
-		if (!morph_table)
-			return -ENOMEM;
+		if (!morph_table) {
+			ret = -ENOMEM;
+			goto error;
+		}
 
 		for (i = 0; i < IA_CSS_MORPH_TABLE_NUM_PLANES; i++) {
 			if (copy_from_compatible(morph_table->coordinates_x[i],
-- 
2.40.1


  parent reply	other threads:[~2023-10-06 10:09 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 10:08 [PATCH 0/9] media: fix smatch warnings Hans Verkuil
2023-10-06 10:08 ` [PATCH 1/9] staging: media: atomisp: drop check for reentrant .s_stream() Hans Verkuil
2023-10-09 14:48   ` Hans de Goede
2023-10-06 10:08 ` [PATCH 2/9] media: i2c: adp1653: don't reuse the same node pointer Hans Verkuil
2023-10-10  6:40   ` Sakari Ailus
2023-10-06 10:08 ` Hans Verkuil [this message]
2023-10-09 14:52   ` [PATCH 3/9] staging: media: atomisp: improve unwinding Hans de Goede
2023-10-06 10:08 ` [PATCH 4/9] media: dvb-usb-v2: af9035: fix missing unlock Hans Verkuil
2023-10-13  8:32   ` Hans Verkuil
2023-10-06 10:08 ` [PATCH 5/9] media: nxp: imx-jpeg: use goto instead of return Hans Verkuil
2023-10-06 10:08 ` [PATCH 6/9] media: qcom: venus: fix incorrect return value Hans Verkuil
2023-10-06 10:13   ` Bryan O'Donoghue
2023-10-06 10:08 ` [PATCH 7/9] media: i2c: tc358746: check fmt validity Hans Verkuil
2023-10-10  6:39   ` Sakari Ailus
2023-10-06 10:08 ` [PATCH 8/9] media: i2c: mt9m114: goto proper error path Hans Verkuil
2023-10-06 15:18   ` Laurent Pinchart
2023-10-10  7:24     ` Hans Verkuil
2023-10-10  7:58       ` Laurent Pinchart
2023-10-10  7:59       ` Sakari Ailus
2023-10-10  8:06         ` Hans Verkuil
2023-10-10 15:03           ` Sakari Ailus
2023-10-06 10:08 ` [PATCH 9/9] media: pci: mgb4: fix potential spectre vulnerability Hans Verkuil
2023-10-10 10:31   ` Martin Tůma
2023-10-11  0:35     ` Pawan Gupta
2023-10-11 16:36       ` Hans Verkuil
2023-10-12  9:09       ` Martin Tůma
2023-10-12  9:08   ` Martin Tůma

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=97bf2e6dcba166ba77a9c35e3fe7b0f20a0abf7a.1696586632.git.hverkuil-cisco@xs4all.nl \
    --to=hverkuil-cisco@xs4all.nl \
    --cc=hdegoede@redhat.com \
    --cc=linux-media@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.