Skip to content

Commit 5750bab

Browse files
author
Myron Stowe
committed
PCI: keystone: Fix if-statement expression in ks_pcie_quirk()
JIRA: https://issues.redhat.com/browse/RHEL-59033 Upstream Status: 6188a1c commit 6188a1c Author: Dan Carpenter <dan.carpenter@linaro.org> Date: Fri Jul 19 18:53:26 2024 -0500 PCI: keystone: Fix if-statement expression in ks_pcie_quirk() This code accidentally uses && where || was intended. It potentially results in a NULL dereference. Thus, fix the if-statement expression to use the correct condition. Fixes: 86f271f ("PCI: keystone: Add workaround for Errata #i2037 (AM65x SR 1.0)") Link: https://lore.kernel.org/linux-pci/1b762a93-e1b2-4af3-8c04-c8843905c279@stanley.mountain Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> [kwilczynski: commit log] Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com> Signed-off-by: Myron Stowe <mstowe@redhat.com>
1 parent 82f5603 commit 5750bab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/controller/dwc/pci-keystone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ static void ks_pcie_quirk(struct pci_dev *dev)
577577
*/
578578
if (pci_match_id(am6_pci_devids, bridge)) {
579579
bridge_dev = pci_get_host_bridge_device(dev);
580-
if (!bridge_dev && !bridge_dev->parent)
580+
if (!bridge_dev || !bridge_dev->parent)
581581
return;
582582

583583
ks_pcie = dev_get_drvdata(bridge_dev->parent);

0 commit comments

Comments
 (0)