Skip to content

Commit

Permalink
staging: rts_pstor: potential NULL dereference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vasiliy Kulikov authored and Greg Kroah-Hartman committed Feb 4, 2011
1 parent 4b906e5 commit 37af07d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/rts_pstor/rtsx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 37af07d

Please sign in to comment.