diff mbox series

[-next] Bluetooth: hci_core: Fix error return code in hci_register_dev()

Message ID 20220606134807.4102807-1-yangyingliang@huawei.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [-next] Bluetooth: hci_core: Fix error return code in hci_register_dev() | expand

Checks

Context Check Description
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Yang Yingliang June 6, 2022, 1:48 p.m. UTC
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(-)

Comments

Abhishek Pandit-Subedi June 6, 2022, 6:27 p.m. UTC | #1
On Mon, Jun 6, 2022 at 6:38 AM Yang Yingliang <yangyingliang@huawei.com> wrote:
>
> 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
>

Ah, I missed this. Good catch!

Acked-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
patchwork-bot+bluetooth@kernel.org June 8, 2022, 5 p.m. UTC | #2
Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Marcel Holtmann <marcel@holtmann.org>:

On Mon, 6 Jun 2022 21:48:07 +0800 you wrote:
> 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>
> 
> [...]

Here is the summary with links:
  - [-next] Bluetooth: hci_core: Fix error return code in hci_register_dev()
    https://git.kernel.org/bluetooth/bluetooth-next/c/ad564394b3db

You are awesome, thank you!
diff mbox series

Patch

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);