public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: "Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Rob Herring" <robh@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Niklas Cassel" <cassel@kernel.org>,
	"Siddharth Vadapalli" <s-vadapalli@ti.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Damien Le Moal" <dlemoal@kernel.org>,
	"Yoshihiro Shimoda" <yoshihiro.shimoda.uh@renesas.com>,
	"Aleksandr Mishin" <amishin@t-argos.ru>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"Jan Kiszka" <jan.kiszka@siemens.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] PCI: keystone: Fix && vs || typo
Date: Sun, 21 Jul 2024 13:55:38 +0530	[thread overview]
Message-ID: <20240721082538.GH1908@thinkpad> (raw)
In-Reply-To: <1b762a93-e1b2-4af3-8c04-c8843905c279@stanley.mountain>

On Fri, Jul 19, 2024 at 06:53:26PM -0500, Dan Carpenter wrote:
> This code accidentally uses && where || was intended.  It potentially
> results in a NULL dereference.
> 
> Fixes: 86f271f22bbb ("PCI: keystone: Add workaround for Errata #i2037 (AM65x SR 1.0)")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

- Mani

> ---
>  drivers/pci/controller/dwc/pci-keystone.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c
> index 52c6420ae200..95a471d6a586 100644
> --- a/drivers/pci/controller/dwc/pci-keystone.c
> +++ b/drivers/pci/controller/dwc/pci-keystone.c
> @@ -577,7 +577,7 @@ static void ks_pcie_quirk(struct pci_dev *dev)
>  	 */
>  	if (pci_match_id(am6_pci_devids, bridge)) {
>  		bridge_dev = pci_get_host_bridge_device(dev);
> -		if (!bridge_dev && !bridge_dev->parent)
> +		if (!bridge_dev || !bridge_dev->parent)
>  			return;
>  
>  		ks_pcie = dev_get_drvdata(bridge_dev->parent);
> -- 
> 2.43.0
> 

-- 
மணிவண்ணன் சதாசிவம்

  parent reply	other threads:[~2024-07-21  8:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-19 23:53 [PATCH] PCI: keystone: Fix && vs || typo Dan Carpenter
2024-07-20  6:05 ` Siddharth Vadapalli
2024-07-21  8:25 ` Manivannan Sadhasivam [this message]
2024-08-13 20:23 ` Krzysztof Wilczyński

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=20240721082538.GH1908@thinkpad \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=amishin@t-argos.ru \
    --cc=bhelgaas@google.com \
    --cc=cassel@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=dlemoal@kernel.org \
    --cc=jan.kiszka@siemens.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kishon@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=robh@kernel.org \
    --cc=s-vadapalli@ti.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=vigneshr@ti.com \
    --cc=yoshihiro.shimoda.uh@renesas.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