Skip to content

Commit

Permalink
netlink: don't orphan skb in netlink_trim()
Browse files Browse the repository at this point in the history
Netlink doesn't account skbs to the sending socket, so the there's no
need to orphan the skb before trimming it.

Removing the skb_orphan() call is required for mmap'ed netlink, which uses
a netlink specific skb destructor that must not be invoked before the
final freeing of the skb.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Apr 19, 2013
1 parent 0ebd0ac commit 1298ca4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netlink/af_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ static struct sk_buff *netlink_trim(struct sk_buff *skb, gfp_t allocation)
{
int delta;

skb_orphan(skb);
WARN_ON(skb->sk != NULL);

delta = skb->end - skb->tail;
if (delta * 2 < skb->truesize)
Expand Down

0 comments on commit 1298ca4

Please sign in to comment.