Skip to content

Commit

Permalink
af_key: remove some pointless conditionals before kfree_skb()
Browse files Browse the repository at this point in the history
Remove some pointless conditionals before kfree_skb().

Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Wei Yongjun authored and davem330 committed Feb 27, 2009
1 parent fbbfb98 commit 6f96106
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/key/af_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,7 @@ static int pfkey_broadcast(struct sk_buff *skb, gfp_t allocation,
if (one_sk != NULL)
err = pfkey_broadcast_one(skb, &skb2, allocation, one_sk);

if (skb2)
kfree_skb(skb2);
kfree_skb(skb2);
kfree_skb(skb);
return err;
}
Expand Down Expand Up @@ -3573,8 +3572,7 @@ static int pfkey_sendmsg(struct kiocb *kiocb,
out:
if (err && hdr && pfkey_error(hdr, err, sk) == 0)
err = 0;
if (skb)
kfree_skb(skb);
kfree_skb(skb);

return err ? : len;
}
Expand Down

0 comments on commit 6f96106

Please sign in to comment.