tipc: eliminate potential memory leak
authorJon Maloy <jon.maloy@ericsson.com>
Mon, 11 Dec 2017 18:11:55 +0000 (19:11 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Dec 2017 18:44:36 +0000 (13:44 -0500)
commitc545a945d0d9ea2ea2c7d23d43cf0d86e32cd7cf
tree60223c66b9a9c5f74ece0905e9506155a5de0b5b
parent83593010d3b87601e775f240ce46c53ddf25828d
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 <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/socket.c