lkml.org 
[lkml]   [2010]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] netlink: Fix kfree NULL pointer
From
On Wed, Sep 8, 2010 at 1:55 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le mercredi 08 septembre 2010 à 13:33 +0800, jovi zhang a écrit :
>
>> YES, maybe kfree(NULL) is legal, but I cannot see there have any need
>> to invoke kfree(NULL) in this function.
>>  Also I check kfree usage in other code, I havn't find any kfree(NULL) usage.
>
> We have hundred call sites doing kfree(NULL), if it makes code shorter.
>
> Its usually code path handling exceptions (errors if you prefer), and we
> prefer to use ugly gotos, and even kfree(NULL), to make it as short as
> possible.

OK, I understand.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-09-08 08:17    [W:3.875 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site