| From 518bc07147819be1f7d3ddfbcc7b352c1a0cad60 Mon Sep 17 00:00:00 2001 |
| From: Dan Carpenter <dan.carpenter@oracle.com> |
| Date: Tue, 19 Nov 2019 09:17:05 +0300 |
| Subject: [PATCH] Bluetooth: delete a stray unlock |
| |
| commit df66499a1fab340c167250a5743931dc50d5f0fa upstream. |
| |
| 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: a514b17fab51 ("Bluetooth: Refactor locking in amp_physical_cfm") |
| Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> |
| Signed-off-by: Marcel Holtmann <marcel@holtmann.org> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c |
| index 771e3e17bb6a..2c8ff1854beb 100644 |
| --- a/net/bluetooth/l2cap_core.c |
| +++ b/net/bluetooth/l2cap_core.c |
| @@ -4928,10 +4928,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); |
| -- |
| 2.7.4 |
| |