]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
Bluetooth: Fix possible infinite recursion of btusb_reset
authorHsin-chen Chuang <chharry@chromium.org>
Mon, 20 Jan 2025 10:39:39 +0000 (18:39 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 29 Jan 2025 20:23:18 +0000 (15:23 -0500)
The function enters infinite recursion if the HCI device doesn't support
GPIO reset: btusb_reset -> hdev->reset -> vendor_reset -> btusb_reset...

btusb_reset shouldn't call hdev->reset after commit f07d478090b0
("Bluetooth: Get rid of cmd_timeout and use the reset callback")

Fixes: f07d478090b0 ("Bluetooth: Get rid of cmd_timeout and use the reset callback")
Signed-off-by: Hsin-chen Chuang <chharry@chromium.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
drivers/bluetooth/btusb.c

index 145b3fbfff55036da3e2748f56a03471818a593a..90966dfbd2781f64a2babe0a6ba45543851950e5 100644 (file)
@@ -899,11 +899,6 @@ static void btusb_reset(struct hci_dev *hdev)
        struct btusb_data *data;
        int err;
 
-       if (hdev->reset) {
-               hdev->reset(hdev);
-               return;
-       }
-
        data = hci_get_drvdata(hdev);
        /* This is not an unbalanced PM reference since the device will reset */
        err = usb_autopm_get_interface(data->intf);