Skip to content

Commit b06ab67

Browse files
lztogregkh
authored andcommitted
misc: alcor_pci: fix inverted branch condition
commit 281e468 upstream. This patch fixes a trivial mistake that I made in the previous attempt in fixing the null bridge issue. The branch condition is inverted and we should call alcor_pci_find_cap_offset() only if bridge is not null. Reported-by: Colin Ian King <[email protected]> Fixes: 3ce3e45 ("misc: alcor_pci: fix null-ptr-deref when there is no PCI bridge") Signed-off-by: Tong Zhang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f408843 commit b06ab67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/misc/cardreader/alcor_pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static void alcor_pci_init_check_aspm(struct alcor_pci_priv *priv)
138138
* priv->parent_pdev will be NULL. In this case we don't check its
139139
* capability and disable ASPM completely.
140140
*/
141-
if (!priv->parent_pdev)
141+
if (priv->parent_pdev)
142142
priv->parent_cap_off = alcor_pci_find_cap_offset(priv,
143143
priv->parent_pdev);
144144

0 commit comments

Comments
 (0)