Coccinelle archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: kernel-janitors@vger.kernel.org, s32@nxp.com,
	linux-gpio@vger.kernel.org, opensource.kernel@vivo.com,
	Chester Lin <clin@suse.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Lu Hongfei <luhongfei@vivo.com>
Cc: LKML <linux-kernel@vger.kernel.org>, cocci@inria.fr
Subject: Re: [cocci] [PATCH] pinctrl: nxp: Fix resource leaks in for_each_child_of_node() loops
Date: Mon, 12 Jun 2023 16:01:00 +0200	[thread overview]
Message-ID: <fca44dcf-e632-fed6-aee9-03a5b0c6b1d9@web.de> (raw)
In-Reply-To: <20230606070201.14249-1-luhongfei@vivo.com>

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

Regards,
Markus

       reply	other threads:[~2023-06-12 14:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230606070201.14249-1-luhongfei@vivo.com>
2023-06-12 14:01 ` Markus Elfring [this message]
     [not found]   ` <ZIgPl0UShltd0VEe@linux-8mug>
2023-06-13  9:15     ` [cocci] [PATCH] pinctrl: nxp: Adjust error predicates for improved exception handling in s32_dt_node_to_map()? Markus Elfring

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=fca44dcf-e632-fed6-aee9-03a5b0c6b1d9@web.de \
    --to=markus.elfring@web.de \
    --cc=clin@suse.com \
    --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 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 read-only IMAP folder(s) and NNTP newsgroup(s).