diff options
author | Tong Zhang <ztong0001@gmail.com> | 2021-05-22 07:37:25 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-07-20 17:10:53 +0300 |
commit | b06ab67bd63b51222645f5bf9f1ea25b2bc73721 (patch) | |
tree | 9dc48c2d358e66384fc3f28e9947c02802a1fd27 | |
parent | f40884382995ff4ef416003ee4fbadac0376d20a (diff) | |
download | linux-b06ab67bd63b51222645f5bf9f1ea25b2bc73721.tar.xz |
misc: alcor_pci: fix inverted branch condition
commit 281e468446994a7672733af2bf941f4110d4a895 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 <colin.king@canonical.com>
Fixes: 3ce3e45cc333 ("misc: alcor_pci: fix null-ptr-deref when there is no PCI bridge")
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
Link: https://lore.kernel.org/r/20210522043725.602179-1-ztong0001@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/misc/cardreader/alcor_pci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/cardreader/alcor_pci.c b/drivers/misc/cardreader/alcor_pci.c index afd409a5efae..1fadb95b85b0 100644 --- a/drivers/misc/cardreader/alcor_pci.c +++ b/drivers/misc/cardreader/alcor_pci.c @@ -138,7 +138,7 @@ static void alcor_pci_init_check_aspm(struct alcor_pci_priv *priv) * priv->parent_pdev will be NULL. In this case we don't check its * capability and disable ASPM completely. */ - if (!priv->parent_pdev) + if (priv->parent_pdev) priv->parent_cap_off = alcor_pci_find_cap_offset(priv, priv->parent_pdev); |