Skip to content

Commit

Permalink
Bluetooth: hci_core: fix error handling in hci_register_dev()
Browse files Browse the repository at this point in the history
[ Upstream commit 0d75da3 ]

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: 9952d90 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Yang Yingliang authored and gregkh committed Dec 31, 2022
1 parent b17b320 commit 66324c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 66324c5

Please sign in to comment.