From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 8 Jun 2022 16:46:13 +0300
Subject: Bluetooth: fix an error code in hci_register_dev()
Patch-mainline: v6.0-rc1
Git-commit: 9111786492f13501baf576b772c96bf0e4d5bbcb
References: jsc#PED-1407
Preserve the error code from hci_register_suspend_notifier(). Don't
return success.
Fixes: d6bb2a91f95b ("Bluetooth: Unregister suspend with userchannel")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Acked-by: Lee, Chun-Yi <jlee@suse.com>
---
net/bluetooth/hci_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2647,7 +2647,8 @@ int hci_register_dev(struct hci_dev *hde
hci_sock_dev_event(hdev, HCI_DEV_REG);
hci_dev_hold(hdev);
- if (hci_register_suspend_notifier(hdev))
+ error = hci_register_suspend_notifier(hdev);
+ if (error)
goto err_wqueue;
queue_work(hdev->req_workqueue, &hdev->power_on);