From: Jaganath Kanakkassery Date: Thu, 19 Jul 2012 07:24:04 +0000 (+0530) Subject: Bluetooth: Fix socket not getting freed if l2cap channel create fails X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=49dfbb9129c4edb318578de35cc45c555df37884;p=linux-beck.git Bluetooth: Fix socket not getting freed if l2cap channel create fails If l2cap_chan_create() fails then it will return from l2cap_sock_kill since zapped flag of sk is reset. Signed-off-by: Jaganath Kanakkassery Signed-off-by: Gustavo Padovan --- diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index a4bb27e8427e..b94abd30e6f9 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c @@ -1174,7 +1174,7 @@ static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, int p chan = l2cap_chan_create(); if (!chan) { - l2cap_sock_kill(sk); + sk_free(sk); return NULL; }