Messages in this thread | | | Subject | RE: [patch] rapidio: potential null deref on failure path | Date | Mon, 21 Mar 2011 11:34:44 -0700 | From | "Bounine, Alexandre" <> |
| |
> From: Dan Carpenter [mailto:error27@gmail.com] > Sent: Saturday, March 19, 2011 12:41 AM > To: Matt Porter > Cc: Bounine, Alexandre; linux-kernel@vger.kernel.org; kernel- > janitors@vger.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@gmail.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);
Acked-by: Alexandre Bounine <alexandre.bounine@idt.com>
| |