Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c545a945 authored by Jon Maloy's avatar Jon Maloy Committed by David S. Miller
Browse files

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: default avatarJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 83593010
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1140,7 +1140,7 @@ void tipc_sk_mcast_rcv(struct net *net, struct sk_buff_head *arrvq,
				__skb_dequeue(arrvq);
				__skb_queue_tail(inputq, skb);
			}
			refcount_dec(&skb->users);
			kfree_skb(skb);
			spin_unlock_bh(&inputq->lock);
			continue;
		}