lkml.org 
[lkml]   [2022]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -next] Bluetooth: hci_core: Fix error return code in hci_register_dev()
Date
If hci_register_suspend_notifier() fails, it should return error
code in hci_register_dev().

Fixes: d6bb2a91f95b ("Bluetooth: Unregister suspend with userchannel")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
net/bluetooth/hci_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index a4b4b3b927f2..dbddf891a4a9 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2646,7 +2646,8 @@ int hci_register_dev(struct hci_dev *hdev)
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);
--
2.25.1
\
 
 \ /
  Last update: 2022-06-06 15:40    [W:0.419 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site