Blob Blame History Raw
From: Tom Rix <trix@redhat.com>
Date: Tue, 1 Feb 2022 09:42:56 -0800
Subject: Bluetooth: hci_sync: fix undefined return of
 hci_disconnect_all_sync()
Patch-mainline: v5.18-rc1
Git-commit: 8cd3c55c629efd91e5f2b3e89d850575c5b90d47
References: jsc#PED-1407

clang static analysis reports this problem
hci_sync.c:4428:2: warning: Undefined or garbage value
  returned to caller
        return err;
        ^~~~~~~~~~

If there are no connections this function is a noop but
err is never set and a false error could be reported.
Return 0 as other hci_* functions do.

Fixes: 182ee45da083 ("Bluetooth: hci_sync: Rework hci_suspend_notifier")
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Acked-by: Lee, Chun-Yi <jlee@suse.com>
---
 net/bluetooth/hci_sync.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -4425,7 +4425,7 @@ static int hci_disconnect_all_sync(struc
 			return err;
 	}
 
-	return err;
+	return 0;
 }
 
 /* This function perform power off HCI command sequence as follows: