public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Scott Branden <scott.branden@broadcom.com>
To: Yang Li <yang.lee@linux.alibaba.com>, perex@perex.cz
Cc: tiwai@suse.com, rjui@broadcom.com, sbranden@broadcom.com,
	bcm-kernel-feedback-list@broadcom.com,
	alsa-devel@alsa-project.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, lgirdwood@gmail.com
Subject: Re: [PATCH] ASoC: bcm: add missing call to of_node_put()
Date: Mon, 8 Mar 2021 12:10:26 -0800	[thread overview]
Message-ID: <29d19f50-599f-fb9c-65e8-78fa5a30728f@broadcom.com> (raw)
In-Reply-To: <1615187934-39505-1-git-send-email-yang.lee@linux.alibaba.com>

[-- Attachment #1: Type: text/plain, Size: 1320 bytes --]

Hi Yang,

On 2021-03-07 11:18 p.m., Yang Li wrote:
> In one of the error paths of the for_each_child_of_node() loop,
> add missing call to of_node_put().
> 
> Fix the following coccicheck warning:
> ./sound/soc/bcm/cygnus-ssp.c:1346:1-33: WARNING: Function
> "for_each_available_child_of_node" should have of_node_put() before
> return around line 1352.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>  sound/soc/bcm/cygnus-ssp.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/bcm/cygnus-ssp.c b/sound/soc/bcm/cygnus-ssp.c
> index 6e634b4..aa16a23 100644
> --- a/sound/soc/bcm/cygnus-ssp.c
> +++ b/sound/soc/bcm/cygnus-ssp.c
> @@ -1348,8 +1348,10 @@ static int cygnus_ssp_probe(struct platform_device *pdev)
>  					&cygnus_ssp_dai[active_port_count]);
>  
>  		/* negative is err, 0 is active and good, 1 is disabled */
> -		if (err < 0)
> +		if (err < 0) {
> +			of_node_put(child_node);
If such is needed in probe what about the other child_nodes in for_each_child_of_node loop that have already been parsed and succeeded.  Do they need additional cleanup as well?
>  			return err;
> +		}
>  		else if (!err) {
>  			dev_dbg(dev, "Activating DAI: %s\n",
>  				cygnus_ssp_dai[active_port_count].name);
> 


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4212 bytes --]

      reply	other threads:[~2021-03-08 20:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08  7:18 [PATCH] ASoC: bcm: add missing call to of_node_put() Yang Li
2021-03-08 20:10 ` Scott Branden [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=29d19f50-599f-fb9c-65e8-78fa5a30728f@broadcom.com \
    --to=scott.branden@broadcom.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    --cc=tiwai@suse.com \
    --cc=yang.lee@linux.alibaba.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