mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
staging: rts_pstor: potential NULL dereference
pci_get_bus_and_slot() may return NULL, but the caller checks wrong variable. Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
4b906e58a1
commit
37af07d19a
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue