[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0CE8B6BE3C4AD74AB97D9D29BD24E55201A588F5@CORPEXCH1.na.ads.idt.com>
Date: Mon, 21 Mar 2011 05:49:06 -0700
From: "Bounine, Alexandre" <Alexandre.Bounine@....com>
To: "Dan Carpenter" <error27@...il.com>,
"Matt Porter" <mporter@...nel.crashing.org>
Cc: <linux-kernel@...r.kernel.org>, <kernel-janitors@...r.kernel.org>
Subject: RE: [patch] rapidio: potential null deref on failure path
Better to combine both conditions:
if (rio_is_switch(rdev) && rswitch->route_table))
kfree(rswitch->route_table);
Because there is situation when routine fails to allocate route_table
for a switch.
Alex.
-----Original Message-----
From: Dan Carpenter [mailto:error27@...il.com]
Sent: Saturday, March 19, 2011 12:41 AM
To: Matt Porter
Cc: Bounine, Alexandre; linux-kernel@...r.kernel.org;
kernel-janitors@...r.kernel.org
Subject: [patch] rapidio: potential null deref on failure path
If rio is not a switch then "rswitch" is null.
Signed-off-by: Dan Carpenter <error27@...il.com>
diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c
index a50391b..3a59d5f 100644
--- a/drivers/rapidio/rio-scan.c
+++ b/drivers/rapidio/rio-scan.c
@@ -517,7 +517,7 @@ static struct rio_dev __devinit
*rio_setup_device(struct rio_net *net,
return rdev;
cleanup:
- if (rswitch->route_table)
+ if (rio_is_switch(rdev))
kfree(rswitch->route_table);
kfree(rdev);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists