Skip to content

Commit

Permalink
Bluetooth: delete a stray unlock
Browse files Browse the repository at this point in the history
We used to take a lock in amp_physical_cfm() but then we moved it to
the caller function.  Unfortunately the unlock on this error path was
overlooked so it leads to a double unlock.

Fixes: a514b17 ("Bluetooth: Refactor locking in amp_physical_cfm")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Dan Carpenter authored and Marcel Holtmann committed Nov 19, 2019
1 parent b8dc647 commit df66499
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4936,10 +4936,8 @@ void __l2cap_physical_cfm(struct l2cap_chan *chan, int result)
BT_DBG("chan %p, result %d, local_amp_id %d, remote_amp_id %d",
chan, result, local_amp_id, remote_amp_id);

if (chan->state == BT_DISCONN || chan->state == BT_CLOSED) {
l2cap_chan_unlock(chan);
if (chan->state == BT_DISCONN || chan->state == BT_CLOSED)
return;
}

if (chan->state != BT_CONNECTED) {
l2cap_do_create(chan, result, local_amp_id, remote_amp_id);
Expand Down

0 comments on commit df66499

Please sign in to comment.