DORMANTno replies

[PATCH] RapidIO: fix potential null deref in rio_setup_device()

From: Alexandre Bounine <hidden>
Date: 2011-09-06 18:46:06
Also in: lkml
Subsystem: rapidio subsystem, the rest · Maintainers: Matt Porter, Alexandre Bounine, Linus Torvalds

The "goto cleanup" path can deference "rswitch" when it is NULL.

Reported-by: Dan Carpenter <redacted>
Signed-off-by: Alexandre Bounine <redacted>
Cc: Dan Carpenter <redacted>
Cc: Kumar Gala <redacted>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Chul Kim <redacted>
---
 drivers/rapidio/rio-scan.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c
index ebe77dd..5b2cb53 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);
-- 
1.7.6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help