lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20211018110852.GA17623@lpieralisi>
Date:   Mon, 18 Oct 2021 12:08:52 +0100
From:   Lorenzo Pieralisi <lorenzo.pieralisi@....com>
To:     Wan Jiabing <wanjiabing@...o.com>
Cc:     Alyssa Rosenzweig <alyssa@...enzweig.io>,
        Marc Zyngier <maz@...nel.org>, Rob Herring <robh@...nel.org>,
        Krzysztof WilczyƄski <kw@...ux.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>, linux-pci@...r.kernel.org,
        linux-kernel@...r.kernel.org, kael_w@...h.net
Subject: Re: [PATCH] PCI: apple: Add of_node_put() before return

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@...o.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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ