summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2017-12-11 19:11:55 +0100
committerDavid S. Miller <davem@davemloft.net>2017-12-13 19:44:36 +0100
commitc545a945d0d9ea2ea2c7d23d43cf0d86e32cd7cf (patch)
tree60223c66b9a9c5f74ece0905e9506155a5de0b5b /net
parentnet: remove duplicate includes (diff)
downloadlinux-c545a945d0d9ea2ea2c7d23d43cf0d86e32cd7cf.tar.xz
linux-c545a945d0d9ea2ea2c7d23d43cf0d86e32cd7cf.zip
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>
Diffstat (limited to 'net')
-rw-r--r--net/tipc/socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 5d18c0caa92b..41127d0b925e 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -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;
}