Commit 37af07d1 authored by Vasiliy Kulikov's avatar Vasiliy Kulikov Committed by Greg Kroah-Hartman

staging: rts_pstor: potential NULL dereference

pci_get_bus_and_slot() may return NULL, but the caller checks
wrong variable.
Signed-off-by: default avatarVasiliy Kulikov <segoon@openwall.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4b906e58
......@@ -334,7 +334,7 @@ int rtsx_read_pci_cfg_byte(u8 bus, u8 dev, u8 func, u8 offset, u8 *val)
u8 devfn = (dev << 3) | func;
pdev = pci_get_bus_and_slot(bus, devfn);
if (!dev)
if (!pdev)
return -1;
pci_read_config_byte(pdev, offset, &data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment