Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Wan Jiabing <wanjiabing@vivo.com>
Cc: "Alyssa Rosenzweig" <alyssa@rosenzweig.io>,
	"Marc Zyngier" <maz@kernel.org>, "Rob Herring" <robh@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	kael_w@yeah.net
Subject: Re: [PATCH] PCI: apple: Add of_node_put() before return
Date: Mon, 18 Oct 2021 12:08:52 +0100	[thread overview]
Message-ID: <20211018110852.GA17623@lpieralisi> (raw)
In-Reply-To: <20211015080920.17619-1-wanjiabing@vivo.com>

On Fri, Oct 15, 2021 at 04:09:20AM -0400, Wan Jiabing wrote:
> Fix following coccicheck warning:
> ./drivers/pci/controller/pcie-apple.c:771:1-23: WARNING: Function
> for_each_child_of_node should have of_node_put() before return
> 
> Early exits from for_each_child_of_node should decrement the
> node reference counter.
> 
> Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
> ---
>  drivers/pci/controller/pcie-apple.c | 1 +
>  1 file changed, 1 insertion(+)

Squashed in the commit it is fixing, updated my pci/apple branch.

Thanks,
Lorenzo

> 
> diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c
> index b4db7a065553..13101389e988 100644
> --- a/drivers/pci/controller/pcie-apple.c
> +++ b/drivers/pci/controller/pcie-apple.c
> @@ -772,6 +772,7 @@ static int apple_pcie_init(struct pci_config_window *cfg)
>  		ret = apple_pcie_setup_port(pcie, of_port);
>  		if (ret) {
>  			dev_err(pcie->dev, "Port %pOF setup fail: %d\n", of_port, ret);
> +			of_node_put(of_port);
>  			return ret;
>  		}
>  	}
> -- 
> 2.20.1
> 

      reply	other threads:[~2021-10-18 11:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15  8:09 [PATCH] PCI: apple: Add of_node_put() before return Wan Jiabing
2021-10-18 11:08 ` Lorenzo Pieralisi [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=20211018110852.GA17623@lpieralisi \
    --to=lorenzo.pieralisi@arm.com \
    --cc=alyssa@rosenzweig.io \
    --cc=bhelgaas@google.com \
    --cc=kael_w@yeah.net \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=robh@kernel.org \
    --cc=wanjiabing@vivo.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