Mat Martineau ef191aded5 Bluetooth: Restore locking semantics when looking up L2CAP channels
As the comment for l2cap_get_chan_by_scid indicated, the function used
to return a locked socket.  The lock for the socket was acquired while
the channel list was also locked.

When locking was moved over to the l2cap_chan structure, the channel
lock was no longer acquired with the channel list still locked.  This
made it possible for the l2cap_chan to be deleted after
conn->chan_lock was released but before l2cap_chan_lock was called.
Making the call to l2cap_chan_lock before releasing conn->chan_lock
makes it impossible for the l2cap_chan to be deleted at the wrong
time.

Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
Reviewed-by: Ulisses Furquim <ulisses@profusion.mobi>
Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
2012-05-16 16:13:51 -03:00
..
2012-04-15 12:44:40 -04:00
2012-04-02 04:33:44 -04:00
2012-04-15 12:44:40 -04:00
2012-04-16 21:08:18 +02:00
2012-04-25 19:47:17 -04:00
2012-05-08 20:25:42 +02:00
2012-05-08 20:25:42 +02:00
2012-04-15 12:44:40 -04:00
2012-04-15 12:44:40 -04:00
2012-04-21 16:24:20 -04:00