diff options
author | Vasiliy Kulikov <segoon@openwall.com> | 2011-02-02 21:29:31 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-04 13:04:23 -0800 |
commit | 37af07d19a53924a70ae42faebf968c04a631c8c (patch) | |
tree | 73b4d0051977a44c4d7b1ef7810c5198d4f08cd7 /drivers/staging/rts_pstor/rtsx.c | |
parent | 4b906e58a1f0a29ce1da4ed832cc6f17e5889772 (diff) | |
download | linux-stable-37af07d19a53924a70ae42faebf968c04a631c8c.tar.gz linux-stable-37af07d19a53924a70ae42faebf968c04a631c8c.tar.bz2 linux-stable-37af07d19a53924a70ae42faebf968c04a631c8c.zip |
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>
Diffstat (limited to 'drivers/staging/rts_pstor/rtsx.c')
-rw-r--r-- | drivers/staging/rts_pstor/rtsx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rts_pstor/rtsx.c b/drivers/staging/rts_pstor/rtsx.c index 9864b1a47116..2b1837999d7d 100644 --- a/drivers/staging/rts_pstor/rtsx.c +++ b/drivers/staging/rts_pstor/rtsx.c @@ -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); |