OSDN Git Service

Bluetooth: hci_core: fix error handling in hci_register_dev()
authorYang Yingliang <yangyingliang@huawei.com>
Thu, 20 Oct 2022 02:16:56 +0000 (10:16 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 12 Dec 2022 22:19:23 +0000 (14:19 -0800)
If hci_register_suspend_notifier() returns error, the hdev and rfkill
are leaked. We could disregard the error and print a warning message
instead to avoid leaks, as it just means we won't be handing suspend
requests.

Fixes: 9952d90ea288 ("Bluetooth: Handle PM_SUSPEND_PREPARE and PM_POST_SUSPEND")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_core.c

index d97fac4..56f8569 100644 (file)
@@ -2660,7 +2660,7 @@ int hci_register_dev(struct hci_dev *hdev)
 
        error = hci_register_suspend_notifier(hdev);
        if (error)
-               goto err_wqueue;
+               BT_WARN("register suspend notifier failed error:%d\n", error);
 
        queue_work(hdev->req_workqueue, &hdev->power_on);