lkml.org 
[lkml]   [2011]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: [patch] rapidio: potential null deref on failure path
Date
From
In this case I agree. 
Do you want me to move this patch up or you have your own path for it?

Alex.

-----Original Message-----
From: Dan Carpenter [mailto:error27@gmail.com]
Sent: Monday, March 21, 2011 11:00 AM
To: Bounine, Alexandre
Cc: Matt Porter; linux-kernel@vger.kernel.org;
kernel-janitors@vger.kernel.org
Subject: Re: [patch] rapidio: potential null deref on failure path

On Mon, Mar 21, 2011 at 05:49:06AM -0700, Bounine, Alexandre wrote:
> 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.
>

kfree() accepts NULL pointers. People have been removing these checks
all over the tree by the hundreds... Sorry I should have mentioned
that.

regards,
dan carpenter




\
 
 \ /
  Last update: 2011-03-21 16:17    [W:0.355 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site