Subject: Re: [PATCH] netlink: Fix kfree NULL pointer

From: [email-masked] (Eric W. Biederman)
Date: Tue, 07 Sep 2010 22:54:52 -0700

jovi zhang <[email-masked]> writes:

> On Wed, Sep 8, 2010 at 1:19 PM, Eric Dumazet <[email-masked]> wrote:
>>
>>
>> This patch is not needed
>>
>> kfree(NULL) is legal
>>
>>
>>
>>
>
> 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.

Usually kfree(NULL) is not explicit, but "var = NULL; kfree(var)" is
common in error handling paths to reduce the complexity of error
handling, making bugs less likely.

Eric