Skip to content

Commit

Permalink
Bluetooth: Fix socket not getting freed if l2cap channel create fails
Browse files Browse the repository at this point in the history
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 <jaganath.k@samsung.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
  • Loading branch information
Jaganath Kanakkassery authored and Gustavo Padovan committed Aug 6, 2012
1 parent d08fd0e commit 49dfbb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/bluetooth/l2cap_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 49dfbb9

Please sign in to comment.