All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] Bluetooth: hci_core: fix error handling in hci_register_dev()
@ 2022-10-20  2:16 Yang Yingliang
  2022-10-20  3:46 ` [v3] " bluez.test.bot
  2022-10-20 21:10 ` [PATCH v3] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Yang Yingliang @ 2022-10-20  2:16 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: marcel, johan.hedberg, luiz.dentz, luiz.von.dentz, yangyingliang

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 <yangyingliang@huawei.com>
---
v2 -> v3:
  print a warning message instead of goto err

v1 -> v2:
  Add rfkill_destroy().
---
 net/bluetooth/hci_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 0540555b3704..9d9fb3dff22a 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -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);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-20 21:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-20  2:16 [PATCH v3] Bluetooth: hci_core: fix error handling in hci_register_dev() Yang Yingliang
2022-10-20  3:46 ` [v3] " bluez.test.bot
2022-10-20 21:10 ` [PATCH v3] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.