* [PATCH] staging: rts_pstor: potential NULL dereference
@ 2011-02-02 18:29 ` Vasiliy Kulikov
0 siblings, 0 replies; 2+ messages in thread
From: Vasiliy Kulikov @ 2011-02-02 18:29 UTC (permalink / raw)
To: kernel-janitors; +Cc: Greg Kroah-Hartman, wwang, devel, linux-kernel
pci_get_bus_and_slot() may return NULL, but the caller checks
wrong variable.
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
---
Compile tested only.
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 9864b1a..2b18379 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);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] staging: rts_pstor: potential NULL dereference
@ 2011-02-02 18:29 ` Vasiliy Kulikov
0 siblings, 0 replies; 2+ messages in thread
From: Vasiliy Kulikov @ 2011-02-02 18:29 UTC (permalink / raw)
To: kernel-janitors; +Cc: Greg Kroah-Hartman, wwang, devel, linux-kernel
pci_get_bus_and_slot() may return NULL, but the caller checks
wrong variable.
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
---
Compile tested only.
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 9864b1a..2b18379 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);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-02 18:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-02 18:29 [PATCH] staging: rts_pstor: potential NULL dereference Vasiliy Kulikov
2011-02-02 18:29 ` Vasiliy Kulikov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.