[PATCH 2/4] Bluetooth: btmtksdio: Fix runtime PM leak in btmtksdio_shutdown()

From: Wentao Liang

Date: Mon Sep 14 2026 - 23:54:20 EST


btmtksdio_shutdown() takes a runtime PM reference with
pm_runtime_get_sync(bdev->dev), which leaves the device's usage
count incremented even when it fails. If the WMT func-ctrl command
fails to send, mtk_hci_wmt_sync() returns a negative error and the
function returns immediately, skipping the pm_runtime_put_noidle()
at the ignore_wmt_cmd label, so the reference is leaked.

Drop the reference with pm_runtime_put_noidle() before returning
the error to keep the usage count balanced.

Fixes: 7f3c563c575e ("Bluetooth: btmtksdio: Add runtime PM support to SDIO based Bluetooth")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
---
drivers/bluetooth/btmtksdio.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
index 243215a81fa7..dfb61653a878 100644
--- a/drivers/bluetooth/btmtksdio.c
+++ b/drivers/bluetooth/btmtksdio.c
@@ -1231,6 +1231,7 @@ static int btmtksdio_shutdown(struct hci_dev *hdev)
err = mtk_hci_wmt_sync(hdev, &wmt_params);
if (err < 0) {
bt_dev_err(hdev, "Failed to send wmt func ctrl (%d)", err);
+ pm_runtime_put_noidle(bdev->dev);
return err;
}

--
2.34.1