summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_sock.c
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2011-04-25 15:10:41 -0300
committerGustavo F. Padovan <padovan@profusion.mobi>2011-04-28 01:10:01 -0300
commit6ff5abbf4e4aa88feb9c2367d4fbd9ea081bf98c (patch)
tree05848e91d3ac481432b3c0718dbb9fd91a5067c1 /net/bluetooth/l2cap_sock.c
parent8c1d787be4b62d2d1b6f04953eca4bcf7c839d44 (diff)
downloadlinux-6ff5abbf4e4aa88feb9c2367d4fbd9ea081bf98c.tar.bz2
Bluetooth: Fix memory leak with L2CAP channels
A new l2cap_chan_free() is added to free the channels. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/l2cap_sock.c')
-rw-r--r--net/bluetooth/l2cap_sock.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 61d93f6c36c8..0e23ebdf7c8f 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -849,6 +849,8 @@ void l2cap_sock_kill(struct sock *sk)
BT_DBG("sk %p state %d", sk, sk->sk_state);
/* Kill poor orphan */
+
+ l2cap_chan_free(l2cap_pi(sk)->chan);
bt_sock_unlink(&l2cap_sk_list, sk);
sock_set_flag(sk, SOCK_DEAD);
sock_put(sk);