From: Chester Lin <clin@suse.com>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: kernel-janitors@vger.kernel.org, s32@nxp.com,
linux-gpio@vger.kernel.org, opensource.kernel@vivo.com,
Linus Walleij <linus.walleij@linaro.org>,
Lu Hongfei <luhongfei@vivo.com>,
LKML <linux-kernel@vger.kernel.org>,
cocci@inria.fr
Subject: Re: [PATCH] pinctrl: nxp: Fix resource leaks in for_each_child_of_node() loops
Date: Tue, 13 Jun 2023 14:41:27 +0800 [thread overview]
Message-ID: <ZIgPl0UShltd0VEe@linux-8mug> (raw)
In-Reply-To: <fca44dcf-e632-fed6-aee9-03a5b0c6b1d9@web.de>
On Mon, Jun 12, 2023 at 04:01:00PM +0200, Markus Elfring wrote:
> > Ensure child node references are decremented properly in the error path.
> …
> > +++ b/drivers/pinctrl/nxp/pinctrl-s32cc.c
> > @@ -279,8 +279,10 @@ static int s32_dt_node_to_map(struct pinctrl_dev *pctldev,
> > ret = s32_dt_group_node_to_map(pctldev, np, map,
> > &reserved_maps, num_maps,
> > np_config->name);
> > - if (ret < 0)
> > + if (ret < 0) {
> > + of_node_put(np);
> > break;
> > + }
> > }
> >
> > if (ret)
>
> May the same error predicate be applied at two places here?
>
I think these two error predicates can be combined together in another patch.
Regards,
Chester
> Regards,
> Markus
next prev parent reply other threads:[~2023-06-13 6:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 7:02 [PATCH] pinctrl: nxp: Fix resource leaks in for_each_child_of_node() loops Lu Hongfei
2023-06-09 7:25 ` Linus Walleij
2023-06-12 14:01 ` [cocci] " Markus Elfring
2023-06-13 6:41 ` Chester Lin [this message]
2023-06-13 9:15 ` [cocci] [PATCH] pinctrl: nxp: Adjust error predicates for improved exception handling in s32_dt_node_to_map()? Markus Elfring
2023-06-13 9:27 ` Chester Lin
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=ZIgPl0UShltd0VEe@linux-8mug \
--to=clin@suse.com \
--cc=Markus.Elfring@web.de \
--cc=cocci@inria.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luhongfei@vivo.com \
--cc=opensource.kernel@vivo.com \
--cc=s32@nxp.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 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.