aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Bounine <[email protected]>2011-11-02 13:39:11 -0700
committerLinus Torvalds <[email protected]>2011-11-02 16:07:01 -0700
commit166c050bda80bb5dd627a287b6efcdfb68d172b4 (patch)
tree840b302ae67f40a735f9612ad5243d5f012aa57a
parent48618fb4e522d9d02e217ac05f52749545c1af20 (diff)
RapidIO: fix potential null deref in rio_setup_device()
The "goto cleanup" path can deference "rswitch" when it is NULL. Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Alexandre Bounine <[email protected]> Cc: Dan Carpenter <[email protected]> Cc: Kumar Gala <[email protected]> Cc: Matt Porter <[email protected]> Cc: Chul Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--drivers/rapidio/rio-scan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c
index 0914f49b0a53..2bebd791a092 100644
--- a/drivers/rapidio/rio-scan.c
+++ b/drivers/rapidio/rio-scan.c
@@ -516,7 +516,7 @@ static struct rio_dev __devinit *rio_setup_device(struct rio_net *net,
return rdev;
cleanup:
- if (rio_is_switch(rdev))
+ if (rswitch)
kfree(rswitch->route_table);
kfree(rdev);