Skip to content

Commit

Permalink
[TIPC]: Remove redundant NULL check when discarding buffers
Browse files Browse the repository at this point in the history
This patch eliminates a null pointer check when discarding a
TIPC message buffer, since kfree_skb() already handles this
situation.

Acknowledgements to Florian Westphal (fw@strlen.de> for
suggesting this enhancement.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Allan Stephens authored and David S. Miller committed Apr 16, 2008
1 parent dec827d commit 11ecede
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/tipc/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,7 @@ static inline struct sk_buff *buf_acquire(u32 size)

static inline void buf_discard(struct sk_buff *skb)
{
if (likely(skb != NULL))
kfree_skb(skb);
kfree_skb(skb);
}

#endif

0 comments on commit 11ecede

Please sign in to comment.