Skip to content

Commit c545a94

Browse files
Jon Maloydavem330
authored andcommitted
tipc: eliminate potential memory leak
In the function tipc_sk_mcast_rcv() we call refcount_dec(&skb->users) on received sk_buffers. Since the reference counter might hit zero at this point, we have a potential memory leak. We fix this by replacing refcount_dec() with kfree_skb(). Signed-off-by: Jon Maloy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8359301 commit c545a94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/tipc/socket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ void tipc_sk_mcast_rcv(struct net *net, struct sk_buff_head *arrvq,
11401140
__skb_dequeue(arrvq);
11411141
__skb_queue_tail(inputq, skb);
11421142
}
1143-
refcount_dec(&skb->users);
1143+
kfree_skb(skb);
11441144
spin_unlock_bh(&inputq->lock);
11451145
continue;
11461146
}

0 commit comments

Comments
 (0)