misc: alcor_pci: fix inverted branch condition
authorTong Zhang <ztong0001@gmail.com>
Sat, 22 May 2021 04:37:25 +0000 (00:37 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:02:28 +0000 (16:02 +0200)
commiteeae4230dbf181f318a6604a74106765e0c66248
treea11ac6d9efdd04e3ba86ca1495e0aa882c3b4789
parent8898558843d3311c9225c1216bee8017e1215adb
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>
drivers/misc/cardreader/alcor_pci.c