* [PATCH] PCI: keystone: Fix && vs || typo
@ 2024-07-19 23:53 Dan Carpenter
2024-07-20 6:05 ` Siddharth Vadapalli
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2024-07-19 23:53 UTC (permalink / raw)
To: Kishon Vijay Abraham I
Cc: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Manivannan Sadhasivam, Niklas Cassel,
Siddharth Vadapalli, Uwe Kleine-König, Damien Le Moal,
Yoshihiro Shimoda, Aleksandr Mishin, Vignesh Raghavendra,
Jan Kiszka, linux-pci, linux-kernel, kernel-janitors
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>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] PCI: keystone: Fix && vs || typo
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
2024-08-13 20:23 ` Krzysztof Wilczyński
2 siblings, 0 replies; 4+ messages in thread
From: Siddharth Vadapalli @ 2024-07-20 6:05 UTC (permalink / raw)
To: Dan Carpenter
Cc: Kishon Vijay Abraham I, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Manivannan Sadhasivam, Niklas Cassel, Siddharth Vadapalli,
Uwe Kleine-König, Damien Le Moal, Yoshihiro Shimoda,
Aleksandr Mishin, Vignesh Raghavendra, Jan Kiszka, linux-pci,
linux-kernel, kernel-janitors
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>
Thank you for the fix.
Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Regards,
Siddharth.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] PCI: keystone: Fix && vs || typo
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
2024-08-13 20:23 ` Krzysztof Wilczyński
2 siblings, 0 replies; 4+ messages in thread
From: Manivannan Sadhasivam @ 2024-07-21 8:25 UTC (permalink / raw)
To: Dan Carpenter
Cc: Kishon Vijay Abraham I, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Niklas Cassel, Siddharth Vadapalli, Uwe Kleine-König,
Damien Le Moal, Yoshihiro Shimoda, Aleksandr Mishin,
Vignesh Raghavendra, Jan Kiszka, linux-pci, linux-kernel,
kernel-janitors
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
>
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] PCI: keystone: Fix && vs || typo
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
@ 2024-08-13 20:23 ` Krzysztof Wilczyński
2 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Wilczyński @ 2024-08-13 20:23 UTC (permalink / raw)
To: Dan Carpenter
Cc: Kishon Vijay Abraham I, Lorenzo Pieralisi, Rob Herring,
Bjorn Helgaas, Manivannan Sadhasivam, Niklas Cassel,
Siddharth Vadapalli, Uwe Kleine-König, Damien Le Moal,
Yoshihiro Shimoda, Aleksandr Mishin, Vignesh Raghavendra,
Jan Kiszka, linux-pci, linux-kernel, kernel-janitors
Hello,
> This code accidentally uses && where || was intended. It potentially
> results in a NULL dereference.
Applied to controller/keystone, thank you!
[1/1] PCI: keystone: Fix if-statement expression in ks_pcie_quirk()
https://git.kernel.org/pci/pci/c/6188a1c762eb
Krzysztof
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-08-13 20:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2024-08-13 20:23 ` Krzysztof Wilczyński
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox