X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=net%2Fbluetooth%2Fl2cap.c;h=a4849f2c1d81aff0287084ea5aff51a294442591;hb=855808392adf499a29e6bdb418f9474726ecbace;hp=7c5459c8e8efdf9e7e9e51d485c9f9ff99eb20f9;hpb=3ab2273175bd59616b6e85c0f88b154e8bd97413;p=linux-2.6-omap-h63xx.git diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 7c5459c8e8e..a4849f2c1d8 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c @@ -62,7 +62,7 @@ static u32 l2cap_feat_mask = 0x0000; static const struct proto_ops l2cap_sock_ops; static struct bt_sock_list l2cap_sk_list = { - .lock = RW_LOCK_UNLOCKED + .lock = __RW_LOCK_UNLOCKED(l2cap_sk_list.lock) }; static void __l2cap_sock_close(struct sock *sk, int reason); @@ -417,7 +417,8 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err) l2cap_sock_kill(sk); } - del_timer_sync(&conn->info_timer); + if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT) + del_timer_sync(&conn->info_timer); hcon->l2cap_data = NULL; kfree(conn); @@ -1498,7 +1499,7 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd goto response; } - sk = l2cap_sock_alloc(parent->sk_net, NULL, BTPROTO_L2CAP, GFP_ATOMIC); + sk = l2cap_sock_alloc(sock_net(parent), NULL, BTPROTO_L2CAP, GFP_ATOMIC); if (!sk) goto response;