From: Yang Yingliang Date: Thu, 20 Oct 2022 02:16:56 +0000 (+0800) Subject: Bluetooth: hci_core: fix error handling in hci_register_dev() X-Git-Tag: v6.0.16~531 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ead0edfc426ab54863e5798cdf7bd17ca42c7d84;p=thirdparty%2Fkernel%2Fstable.git Bluetooth: hci_core: fix error handling in hci_register_dev() [ Upstream commit 0d75da38e060d21f948b3df5f5e349c962cf1ed2 ] 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 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index c8ea03edd081f..995d950872af9 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -2653,7 +2653,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);