Message ID | 8b4203dc-bc0a-4c00-8862-e2d0ed6e346b@web.de (mailing list archive) |
---|---|
State | Rejected |
Headers |
Received: from sv.mirrors.kernel.org ([139.178.88.99]) by linuxtv.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from <linux-media+bounces-6230-patchwork=linuxtv.org@vger.kernel.org>) id 1rg1ij-0001b7-1N for patchwork@linuxtv.org; Fri, 01 Mar 2024 12:10:35 +0000 Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 66D8D288491 for <patchwork@linuxtv.org>; Fri, 1 Mar 2024 12:10:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F1C66E2AB; Fri, 1 Mar 2024 12:10:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="n3l4oFTv" X-Original-To: linux-media@vger.kernel.org Received: from mout.web.de (mout.web.de [212.227.15.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 681FE6D1C8; Fri, 1 Mar 2024 12:10:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709295027; cv=none; b=Qj2Z+SqVzXnO7OZFHXKiIbXK1GsBDZQ9duz/wbhpZntHWbXOEF7aawv9G/+HfEMs+T9V6cKXON2fec6rRDSeT3meJPVGPT/ktxkRRst1zOIXbbK1keA/bitWX8UxMlTH+TPm51jrMABNrJU3KiCiUGrMkuBWUE6muAw10VnUVJk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709295027; c=relaxed/simple; bh=h8r+c+xKuJfgNjc2uCEc8QP+kKYh711JxeWWh1eRyno=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=QLaPByFn3wc/tMgRKIp80FfLzkywSNOHadEA+JFHJxZEDjOSpOa9pMG3F4eIwqiAki7dTOds5fNHTTlnKnKWTUb47rsypYlSI+FZfSTCvVQnaFoXdqgL+kqHv99Wx55aDwIsqtEFPfvlby/MmwIB1ASxtnFezAAJcXvGOXZgqDU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de; spf=pass smtp.mailfrom=web.de; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b=n3l4oFTv; arc=none smtp.client-ip=212.227.15.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1709295017; x=1709899817; i=markus.elfring@web.de; bh=h8r+c+xKuJfgNjc2uCEc8QP+kKYh711JxeWWh1eRyno=; h=X-UI-Sender-Class:Date:To:Cc:From:Subject; b=n3l4oFTv4zuiXWliiZvjBJZbFVEooofgg1ZO8VFnph2rxIxDIl3a1PwgUBQjrmMT 3CXKHW6FF4b6vyDMnzUlebagfMbWFB1jxG9n4ESARXmVD4C5S1vvHorddyG68e7f0 lQYhi6ITZN+s218/gF/ZH194gWzLW3RZfGeiEuwHMpnAySke20j9OOKg4o6tLyPPM NquEwkdm46wXuax9eMfGUuPM/BU96S93UtMW0V5sZo8PDmMk5YedBO+eXwzXrxW6C nt6c4uoCRWZ12c76sAHXggo15J98ZB9xMTCJCHz4raJ9aphV1fTCxk7umrydX7EIJ enaQpavjlDWt6IjlzA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.86.95]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MnG2C-1qz1O03hCe-00jGjk; Fri, 01 Mar 2024 13:10:16 +0100 Message-ID: <8b4203dc-bc0a-4c00-8862-e2d0ed6e346b@web.de> Date: Fri, 1 Mar 2024 13:10:15 +0100 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: <linux-media.vger.kernel.org> List-Subscribe: <mailto:linux-media+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-media+unsubscribe@vger.kernel.org> MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: linux-renesas-soc@vger.kernel.org, linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org, Mauro Carvalho Chehab <mchehab@kernel.org>, =?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se> Content-Language: en-GB Cc: LKML <linux-kernel@vger.kernel.org> From: Markus Elfring <Markus.Elfring@web.de> Subject: [PATCH] media: rcar-csi2: Use common error handling code in rcsi2_parse_dt() Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:e8Qqigu2HipwdgXe/vRLuYUi8hLo5kQbAiTz9sFlCosswWvxxUW 4HX41fYAAKfZdNf+WASi8tNE7buVMkC/he+b+KUcDHvvkQqY/z9y76Jb7Qzeyo9q30gYDjA 9/rYIq4bJT/pg6NXz12dJdcM6sBVfKt5E11ofBT33ffijdD2GKL6ivh3Rb+SN9x5Ialx1k1 TD+xhBj2gEFEgphdDkDuA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:UBnMxTdMKLg=;UNsb8OzDk+kpUby0bo5bEnYl2TL Nw4xE3IVlD2gtfd9iz32rR9iVDP9wTL72Cno/LKep3Sc1a7lOLYls08djqGUV2EI9pgKAwtoW MtjWBIKRApK9d3GA2jjxnyyL41/o8v1P55RlwHJs2CzyZHWiJYIC62fWZQbj5T2YyvsEDZykZ RcO/ZgZqrqSlbhjxdQExSqFUeQuz829ILmjxzOEPAAZfv5nfW9CARciS+G+aGjpEdy5ZtGDEN 7Eu20ZDp0ZhXFwpX3R+N0ylymoLOuhZIO4sfLvmuLLt/gzu5Bc6ebWGOMD7noTgClnKpp6wTz smvimXUuQfBm3egJpr/pLIjEmrfL1x8aE4yPy2+RoVjYDkQL3nqXYh83ZQOhn4bxznKqS8hqE UreOHhP9Zx4ON8X3yfMdZFQ2Q4jZ4gNf7j5aYRM41qEhLVH6e1QCMdSrr1i+YIBRcwN3tiewS zIQ9zjN6BVirtlqJvjBTrjeVbmK0kWa1enFO1cSV3B4hQXLdhBYYVebBuhg8T49e5vYJDdZ9O rGj3H5YspFlCd9s311fdaxfoYM00GcG6fbnN/wrmfjDe5BCZ12jf0nWqBtjPuKfN+B+v/hadt 8ojsjT4DgDw8RIPW76W3CBbVAGJhOyIlUE3lrxUTSgCmD0F8aqLho49n2/kU1rFR66UtdgQ8U 5tu3i+2OzixOAgKVNKXpZbd9kPnTDExkAEKDtKddptb/c32CoQF7VtwrXzln71ZMQDJPUx+KN jT+BmPQrzxkP52XiuQwcL98q4mPU9U3UMfq8c/YeMvyB5QsrtVvNGXuzADJgPDO713Myphypt b+/HQFpyV5gyaTdptna/d6DZCDrMuXtjcnDLBspLPEWog= X-LSpam-Score: -2.0 (--) X-LSpam-Report: No, score=-2.0 required=5.0 tests=ARC_SIGNED=0.001,ARC_VALID=-0.1,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DMARC_PASS=-0.001,FREEMAIL_FORGED_FROMDOMAIN=1,FREEMAIL_FROM=0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=ham autolearn_force=no |
Series |
media: rcar-csi2: Use common error handling code in rcsi2_parse_dt()
|
|
Commit Message
Markus Elfring
March 1, 2024, 12:10 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net> Date: Fri, 1 Mar 2024 13:02:18 +0100 Add a label so that a bit of exception handling can be better reused in an if branch of this function implementation. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/media/platform/renesas/rcar-csi2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.44.0
Comments
Hi Markus, On Fri, Mar 1, 2024 at 1:10 PM Markus Elfring <Markus.Elfring@web.de> wrote: > From: Markus Elfring <elfring@users.sourceforge.net> > Date: Fri, 1 Mar 2024 13:02:18 +0100 > > Add a label so that a bit of exception handling can be better reused > in an if branch of this function implementation. > > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Thanks for your patch! > --- a/drivers/media/platform/renesas/rcar-csi2.c > +++ b/drivers/media/platform/renesas/rcar-csi2.c > @@ -1388,12 +1388,13 @@ static int rcsi2_parse_dt(struct rcar_csi2 *priv) > ret = v4l2_fwnode_endpoint_parse(ep, &v4l2_ep); > if (ret) { > dev_err(priv->dev, "Could not parse v4l2 endpoint\n"); > - fwnode_handle_put(ep); > - return -EINVAL; > + ret = -EINVAL; > + goto put_fwnode_ep; > } > > ret = rcsi2_parse_v4l2(priv, &v4l2_ep); > if (ret) { > +put_fwnode_ep: > fwnode_handle_put(ep); > return ret; > } Please do not use goto to jump to random positions buried deep inside a function,as this makes the code harder to read. Gr{oetje,eeting}s, Geert
On Fri, Mar 01, 2024 at 01:10:15PM +0100, Markus Elfring wrote: > From: Markus Elfring <elfring@users.sourceforge.net> > Date: Fri, 1 Mar 2024 13:02:18 +0100 > > Add a label so that a bit of exception handling can be better reused > in an if branch of this function implementation. > > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Just in case someone may be tempted to apply this: NAK Markus, don't bother replying to this e-mail, I will delete your reply without reading it. > --- > drivers/media/platform/renesas/rcar-csi2.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/platform/renesas/rcar-csi2.c b/drivers/media/platform/renesas/rcar-csi2.c > index 582d5e35db0e..621c92c31965 100644 > --- a/drivers/media/platform/renesas/rcar-csi2.c > +++ b/drivers/media/platform/renesas/rcar-csi2.c > @@ -1388,12 +1388,13 @@ static int rcsi2_parse_dt(struct rcar_csi2 *priv) > ret = v4l2_fwnode_endpoint_parse(ep, &v4l2_ep); > if (ret) { > dev_err(priv->dev, "Could not parse v4l2 endpoint\n"); > - fwnode_handle_put(ep); > - return -EINVAL; > + ret = -EINVAL; > + goto put_fwnode_ep; > } > > ret = rcsi2_parse_v4l2(priv, &v4l2_ep); > if (ret) { > +put_fwnode_ep: > fwnode_handle_put(ep); > return ret; > }
Sakari Ailus pointed out in another thread that we could use __free() instead. Something like this: diff --git a/drivers/media/platform/renesas/rcar-csi2.c b/drivers/media/platform/renesas/rcar-csi2.c index 582d5e35db0e..c569df6057b7 100644 --- a/drivers/media/platform/renesas/rcar-csi2.c +++ b/drivers/media/platform/renesas/rcar-csi2.c @@ -1372,8 +1372,8 @@ static int rcsi2_parse_v4l2(struct rcar_csi2 *priv, static int rcsi2_parse_dt(struct rcar_csi2 *priv) { struct v4l2_async_connection *asc; - struct fwnode_handle *fwnode; - struct fwnode_handle *ep; + struct fwnode_handle *fwnode __free(fwnode_handle) = NULL; + struct fwnode_handle *ep __free(fwnode_handle); struct v4l2_fwnode_endpoint v4l2_ep = { .bus_type = V4L2_MBUS_UNKNOWN, }; @@ -1388,18 +1388,14 @@ static int rcsi2_parse_dt(struct rcar_csi2 *priv) ret = v4l2_fwnode_endpoint_parse(ep, &v4l2_ep); if (ret) { dev_err(priv->dev, "Could not parse v4l2 endpoint\n"); - fwnode_handle_put(ep); return -EINVAL; } ret = rcsi2_parse_v4l2(priv, &v4l2_ep); - if (ret) { - fwnode_handle_put(ep); + if (ret) return ret; - } fwnode = fwnode_graph_get_remote_endpoint(ep); - fwnode_handle_put(ep); dev_dbg(priv->dev, "Found '%pOF'\n", to_of_node(fwnode)); @@ -1408,7 +1404,6 @@ static int rcsi2_parse_dt(struct rcar_csi2 *priv) asc = v4l2_async_nf_add_fwnode(&priv->notifier, fwnode, struct v4l2_async_connection); - fwnode_handle_put(fwnode); if (IS_ERR(asc)) return PTR_ERR(asc);
> Sakari Ailus pointed out in another thread that we could use __free() instead. See also: Contributions by Jonathan Cameron from 2024-02-17 * device property: Move fwnode_handle_put() into property.h https://lore.kernel.org/r/20240217164249.921878-2-jic23@kernel.org * device property: Add cleanup.h based fwnode_handle_put() scope based cleanup. https://lore.kernel.org/r/20240217164249.921878-3-jic23@kernel.org > Something like this: > > diff --git a/drivers/media/platform/renesas/rcar-csi2.c b/drivers/media/platform/renesas/rcar-csi2.c > index 582d5e35db0e..c569df6057b7 100644 > --- a/drivers/media/platform/renesas/rcar-csi2.c > +++ b/drivers/media/platform/renesas/rcar-csi2.c > @@ -1372,8 +1372,8 @@ static int rcsi2_parse_v4l2(struct rcar_csi2 *priv, > static int rcsi2_parse_dt(struct rcar_csi2 *priv) > { > struct v4l2_async_connection *asc; > - struct fwnode_handle *fwnode; > - struct fwnode_handle *ep; > + struct fwnode_handle *fwnode __free(fwnode_handle) = NULL; > + struct fwnode_handle *ep __free(fwnode_handle); > struct v4l2_fwnode_endpoint v4l2_ep = { > .bus_type = V4L2_MBUS_UNKNOWN, > }; I suggest to reconsider the position for the adjusted variable declarations a bit more. > @@ -1388,18 +1388,14 @@ static int rcsi2_parse_dt(struct rcar_csi2 *priv) > ret = v4l2_fwnode_endpoint_parse(ep, &v4l2_ep); > if (ret) { > dev_err(priv->dev, "Could not parse v4l2 endpoint\n"); > - fwnode_handle_put(ep); > return -EINVAL; > } > > ret = rcsi2_parse_v4l2(priv, &v4l2_ep); > - if (ret) { > - fwnode_handle_put(ep); > + if (ret) > return ret; > - } > > fwnode = fwnode_graph_get_remote_endpoint(ep); > - fwnode_handle_put(ep); > > dev_dbg(priv->dev, "Found '%pOF'\n", to_of_node(fwnode)); > > @@ -1408,7 +1404,6 @@ static int rcsi2_parse_dt(struct rcar_csi2 *priv) > > asc = v4l2_async_nf_add_fwnode(&priv->notifier, fwnode, > struct v4l2_async_connection); > - fwnode_handle_put(fwnode); > if (IS_ERR(asc)) > return PTR_ERR(asc); > I find that two function calls marked the end of scopes here which obviously are not at the end of the discussed function implementation. Thus I imagine that the known source code transformation “Reduce scope for variables” will become relevant. https://refactoring.com/catalog/reduceScopeOfVariable.html Regards, Markus
Hi Dan, On Fri, Mar 01, 2024 at 04:42:01PM +0300, Dan Carpenter wrote: > Sakari Ailus pointed out in another thread that we could use __free() > instead. Something like this: > Looks good to me. We could merge this with your SoB (pending Niklas's review). :-) The driver has been since moved under drivers/media/platform/renesas/rcar-vin/ . > diff --git a/drivers/media/platform/renesas/rcar-csi2.c b/drivers/media/platform/renesas/rcar-csi2.c > index 582d5e35db0e..c569df6057b7 100644 > --- a/drivers/media/platform/renesas/rcar-csi2.c > +++ b/drivers/media/platform/renesas/rcar-csi2.c > @@ -1372,8 +1372,8 @@ static int rcsi2_parse_v4l2(struct rcar_csi2 *priv, > static int rcsi2_parse_dt(struct rcar_csi2 *priv) > { > struct v4l2_async_connection *asc; > - struct fwnode_handle *fwnode; > - struct fwnode_handle *ep; > + struct fwnode_handle *fwnode __free(fwnode_handle) = NULL; > + struct fwnode_handle *ep __free(fwnode_handle); > struct v4l2_fwnode_endpoint v4l2_ep = { > .bus_type = V4L2_MBUS_UNKNOWN, > }; > @@ -1388,18 +1388,14 @@ static int rcsi2_parse_dt(struct rcar_csi2 *priv) > ret = v4l2_fwnode_endpoint_parse(ep, &v4l2_ep); > if (ret) { > dev_err(priv->dev, "Could not parse v4l2 endpoint\n"); > - fwnode_handle_put(ep); > return -EINVAL; > } > > ret = rcsi2_parse_v4l2(priv, &v4l2_ep); > - if (ret) { > - fwnode_handle_put(ep); > + if (ret) > return ret; > - } > > fwnode = fwnode_graph_get_remote_endpoint(ep); > - fwnode_handle_put(ep); > > dev_dbg(priv->dev, "Found '%pOF'\n", to_of_node(fwnode)); > > @@ -1408,7 +1404,6 @@ static int rcsi2_parse_dt(struct rcar_csi2 *priv) > > asc = v4l2_async_nf_add_fwnode(&priv->notifier, fwnode, > struct v4l2_async_connection); > - fwnode_handle_put(fwnode); > if (IS_ERR(asc)) > return PTR_ERR(asc); > >
On Mon, Mar 04, 2024 at 10:48:47AM +0000, Sakari Ailus wrote: > Hi Dan, > > On Fri, Mar 01, 2024 at 04:42:01PM +0300, Dan Carpenter wrote: > > Sakari Ailus pointed out in another thread that we could use __free() > > instead. Something like this: > > > > Looks good to me. Thanks for checking! I've never used these before. > > We could merge this with your SoB (pending Niklas's review). :-) The driver > has been since moved under drivers/media/platform/renesas/rcar-vin/ . Alright. I can resend this as a proper patch. regards, dan carpenter
Hi Dan, On 2024-03-04 14:16:56 +0300, Dan Carpenter wrote: > On Mon, Mar 04, 2024 at 10:48:47AM +0000, Sakari Ailus wrote: > > Hi Dan, > > > > On Fri, Mar 01, 2024 at 04:42:01PM +0300, Dan Carpenter wrote: > > > Sakari Ailus pointed out in another thread that we could use __free() > > > instead. Something like this: > > > > > > > Looks good to me. > > Thanks for checking! I've never used these before. > > > > > We could merge this with your SoB (pending Niklas's review). :-) The driver > > has been since moved under drivers/media/platform/renesas/rcar-vin/ . > > Alright. I can resend this as a proper patch. Please do. I do find the idea of scoped operations and the syntax struct fwnode_handle *fwnode __free(fwnode_handle) = NULL; a bit foreign in a C context. But I think the intention is clear and it allows us to avoid having the remember to free the fwnode in error paths which is a nice thing. > > regards, > dan carpenter >
On Sat, Mar 16, 2024 at 10:46:52AM +0100, Niklas Söderlund wrote: > Hi Dan, > > On 2024-03-04 14:16:56 +0300, Dan Carpenter wrote: > > On Mon, Mar 04, 2024 at 10:48:47AM +0000, Sakari Ailus wrote: > > > Hi Dan, > > > > > > On Fri, Mar 01, 2024 at 04:42:01PM +0300, Dan Carpenter wrote: > > > > Sakari Ailus pointed out in another thread that we could use __free() > > > > instead. Something like this: > > > > > > > > > > Looks good to me. > > > > Thanks for checking! I've never used these before. > > > > > > > > We could merge this with your SoB (pending Niklas's review). :-) The driver > > > has been since moved under drivers/media/platform/renesas/rcar-vin/ . > > > > Alright. I can resend this as a proper patch. > > Please do. > > I do find the idea of scoped operations and the syntax > > struct fwnode_handle *fwnode __free(fwnode_handle) = NULL; > > a bit foreign in a C context. But I think the intention is clear and it > allows us to avoid having the remember to free the fwnode in error paths > which is a nice thing. > I said I would send a couple of these but then Markus went ahead and sent the patches that I was going to write... And then it was like, "Oh, these have some questionable style issues" so it wasn't clear what was happening and I lost track. regards, dan carpenter
On 2024-03-16 12:54:23 +0300, Dan Carpenter wrote: > On Sat, Mar 16, 2024 at 10:46:52AM +0100, Niklas Söderlund wrote: > > Hi Dan, > > > > On 2024-03-04 14:16:56 +0300, Dan Carpenter wrote: > > > On Mon, Mar 04, 2024 at 10:48:47AM +0000, Sakari Ailus wrote: > > > > Hi Dan, > > > > > > > > On Fri, Mar 01, 2024 at 04:42:01PM +0300, Dan Carpenter wrote: > > > > > Sakari Ailus pointed out in another thread that we could use __free() > > > > > instead. Something like this: > > > > > > > > > > > > > Looks good to me. > > > > > > Thanks for checking! I've never used these before. > > > > > > > > > > > We could merge this with your SoB (pending Niklas's review). :-) The driver > > > > has been since moved under drivers/media/platform/renesas/rcar-vin/ . > > > > > > Alright. I can resend this as a proper patch. > > > > Please do. > > > > I do find the idea of scoped operations and the syntax > > > > struct fwnode_handle *fwnode __free(fwnode_handle) = NULL; > > > > a bit foreign in a C context. But I think the intention is clear and it > > allows us to avoid having the remember to free the fwnode in error paths > > which is a nice thing. > > > > I said I would send a couple of these but then Markus went ahead and > sent the patches that I was going to write... And then it was like, > "Oh, these have some questionable style issues" so it wasn't clear what > was happening and I lost track. I have not been CCed on any other work in this area for this driver then what's in this thread at least. So if you know of no other work in another thread I think you can go a head and send a proper patch for this driver at least, if you want.
> I said I would send a couple of these but then Markus went ahead and > sent the patches that I was going to write... I dared also to touch some software components. > And then it was like, > "Oh, these have some questionable style issues" The patch review is still evolving, isn't it? > so it wasn't clear what was happening and I lost track. I find such information surprising. There are various source code places left over which could be adjusted somehow. Some contributors would appreciate further clarifications according to desirable collateral evolution. See also: question about kernel cocci and cleanup.h 2024-03-07 https://lore.kernel.org/cocci/CO1PR11MB49149F1167679926A2917E0997202@CO1PR11MB4914.namprd11.prod.outlook.com/ Regards, Markus
diff --git a/drivers/media/platform/renesas/rcar-csi2.c b/drivers/media/platform/renesas/rcar-csi2.c index 582d5e35db0e..621c92c31965 100644 --- a/drivers/media/platform/renesas/rcar-csi2.c +++ b/drivers/media/platform/renesas/rcar-csi2.c @@ -1388,12 +1388,13 @@ static int rcsi2_parse_dt(struct rcar_csi2 *priv) ret = v4l2_fwnode_endpoint_parse(ep, &v4l2_ep); if (ret) { dev_err(priv->dev, "Could not parse v4l2 endpoint\n"); - fwnode_handle_put(ep); - return -EINVAL; + ret = -EINVAL; + goto put_fwnode_ep; } ret = rcsi2_parse_v4l2(priv, &v4l2_ep); if (ret) { +put_fwnode_ep: fwnode_handle_put(ep); return ret; }