Subject: Re: [net-2.6 PATCH 2/6] net: remove kfree_skb on a NULL pointer in af_netlink.c

From: John Fastabend <[email-masked]>
Date: Mon, 21 Sep 2009 12:04:35 +0000

David Miller wrote:
> From: Jeff Kirsher <[email-masked]>
> Date: Thu, 17 Sep 2009 17:57:29 -0700
>
>   
>> From: John Fastabend <[email-masked]>
>>
>> This removes a kfree_skb that is being called on a NULL pointer when
>> do_one_broadcast() is sucessful.  And moves the kfree_skb into
>> do_one_broadcast() for the error case.
>>
>> Signed-off-by: John Fastabend <[email-masked]>
>> Signed-off-by: Jeff Kirsher <[email-masked]>
>>     
>
> kfree_skb() on a NULL pointer is completely legal.
>   
OK, but this depends on the unlikely() macro in kfree_skb() to catch a 
case that is the expected non-error case. Would it be better to wrap the 
kfree_skb() in an if statement to avoid hitting the unlikely() macro?  
Or is the performance hit from the unlikely() macro so small this is not 
an issue?  Thanks for looking at these.

john.