Skip to content

Commit 6188a1c

Browse files
Dan Carpenterkwilczynski
authored andcommitted
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/[email protected] Signed-off-by: Dan Carpenter <[email protected]> [kwilczynski: commit log] Signed-off-by: Krzysztof Wilczyński <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Siddharth Vadapalli <[email protected]>
1 parent 8400291 commit 6188a1c

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)