aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorChris Lu <chris.lu@mediatek.com>2025-04-22 09:21:55 +0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2025-04-25 15:03:19 -0400
commit07e90048e356a29079fbc011cfc2e1fa1d1c5ac9 (patch)
tree17661634fada1bcf4721995f90cafeca44d8d2b0 /drivers/bluetooth
parentBluetooth: btusb: avoid NULL pointer dereference in skb_dequeue() (diff)
downloadlinux-rng-07e90048e356a29079fbc011cfc2e1fa1d1c5ac9.tar.xz
linux-rng-07e90048e356a29079fbc011cfc2e1fa1d1c5ac9.zip
Bluetooth: btmtksdio: Check function enabled before doing close
Check BTMTKSDIO_FUNC_ENABLED flag before doing close to prevent btmtksdio_close been called twice. Fixes: 6ac4233afb9a ("Bluetooth: btmtksdio: Prevent enabling interrupts after IRQ handler removal") Signed-off-by: Chris Lu <chris.lu@mediatek.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/btmtksdio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
index edd5eead1e93..e5a119ca7243 100644
--- a/drivers/bluetooth/btmtksdio.c
+++ b/drivers/bluetooth/btmtksdio.c
@@ -723,6 +723,10 @@ static int btmtksdio_close(struct hci_dev *hdev)
{
struct btmtksdio_dev *bdev = hci_get_drvdata(hdev);
+ /* Skip btmtksdio_close if BTMTKSDIO_FUNC_ENABLED isn't set */
+ if (!test_bit(BTMTKSDIO_FUNC_ENABLED, &bdev->tx_state))
+ return 0;
+
sdio_claim_host(bdev->func);
/* Disable interrupt */