From: Mat Martineau Date: Wed, 2 May 2012 16:42:00 +0000 (-0700) Subject: Bluetooth: Restore locking semantics when looking up L2CAP channels X-Git-Tag: v3.5-rc1~101^2~6^2^2^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef191aded58c5e6860b01f463818584a420a4d6b;p=pandora-kernel.git 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 Reviewed-by: Ulisses Furquim Signed-off-by: Gustavo Padovan --- Reading git-diff-tree failed