linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Jim Quinlan <james.quinlan@broadcom.com>
To: Alex Dewar <alex.dewar90@gmail.com>
Cc: "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
	<linux-arm-kernel@lists.infradead.org>,
	Rob Herring <robh@kernel.org>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Alex Dewar <a.dewar@sussex.ac.uk>,
	"open list:PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS"
	<linux-pci@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE"
	<bcm-kernel-feedback-list@broadcom.com>,
	"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
	<linux-rpi-kernel@lists.infradead.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Jim Quinlan <jquinlan@broadcom.com>,
	Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Subject: Re: [PATCH] PCI: brcmstb: Add missing if statement
Date: Mon, 21 Sep 2020 16:56:58 -0400	[thread overview]
Message-ID: <CA+-6iNwJt4zq1fZv5ujsUJqTs_kcvF9iAcLRp6rtQudwm5CfHA@mail.gmail.com> (raw)
In-Reply-To: <20200921204550.29296-1-a.dewar@sussex.ac.uk>


[-- Attachment #1.1: Type: text/plain, Size: 1429 bytes --]

On Mon, Sep 21, 2020 at 4:45 PM Alex Dewar <alex.dewar90@gmail.com> wrote:
>
> brcm_pcie_resume() contains a return statement that was presumably
> intended to have an "if (ret)" in front of it, otherwise the function
> returns prematurely. Fix this.
>
> I don't know if this code was tested or not, but I assume that this bug
> means that this driver will not resume properly.
>
> Fixes: ad3d29c77e1e ("PCI: brcmstb: Add control of rescal reset")
> Addresses-Coverity: CID 1497099: Control flow issues (UNREACHABLE)
> Signed-off-by: Alex Dewar <a.dewar@sussex.ac.uk>
> ---
>  drivers/pci/controller/pcie-brcmstb.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
> index 7a3ff4632e7c..cb0c11b7308e 100644
> --- a/drivers/pci/controller/pcie-brcmstb.c
> +++ b/drivers/pci/controller/pcie-brcmstb.c
> @@ -1154,6 +1154,7 @@ static int brcm_pcie_resume(struct device *dev)
>         clk_prepare_enable(pcie->clk);
>
>         ret = brcm_phy_start(pcie);
> +       if (ret)

Hello,
Florian suggested adding braces to the if clause and inserting a
"clk_disable_unprepare(-cie->clk);" before the return.  I am fine with
either what you have or implementing Florian's additional suggestion.

Thank you,
Jim Quinlan
Broadcom  STB
>                 return ret;
>
>         /* Take bridge out of reset so we can access the SERDES reg */
> --
> 2.28.0
>

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

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-09-21 21:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21 20:45 [PATCH] PCI: brcmstb: Add missing if statement Alex Dewar
2020-09-21 20:56 ` Jim Quinlan [this message]
2020-09-21 21:16   ` [PATCH v2] PCI: brcmstb: Add missing if statement and error path Alex Dewar
2020-09-21 21:21     ` Florian Fainelli
2020-09-23  8:20     ` Lorenzo Pieralisi

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=CA+-6iNwJt4zq1fZv5ujsUJqTs_kcvF9iAcLRp6rtQudwm5CfHA@mail.gmail.com \
    --to=james.quinlan@broadcom.com \
    --cc=a.dewar@sussex.ac.uk \
    --cc=alex.dewar90@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bhelgaas@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=jquinlan@broadcom.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=nsaenzjulienne@suse.de \
    --cc=robh@kernel.org \
    /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 NNTP newsgroup(s).