* [PATCH] Bluetooth: hci_sync: fix undefined return of hci_disconnect_all_sync()
@ 2022-02-01 17:42 trix
2022-02-01 20:24 ` Luiz Augusto von Dentz
0 siblings, 1 reply; 2+ messages in thread
From: trix @ 2022-02-01 17:42 UTC (permalink / raw)
To: marcel, johan.hedberg, luiz.dentz, davem, kuba, nathan,
ndesaulniers
Cc: linux-bluetooth, netdev, linux-kernel, llvm, Tom Rix
From: Tom Rix <trix@redhat.com>
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>
---
net/bluetooth/hci_sync.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 6e71aa6b6feae..9327737da6003 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -4425,7 +4425,7 @@ static int hci_disconnect_all_sync(struct hci_dev *hdev, u8 reason)
return err;
}
- return err;
+ return 0;
}
/* This function perform power off HCI command sequence as follows:
--
2.26.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Bluetooth: hci_sync: fix undefined return of hci_disconnect_all_sync()
2022-02-01 17:42 [PATCH] Bluetooth: hci_sync: fix undefined return of hci_disconnect_all_sync() trix
@ 2022-02-01 20:24 ` Luiz Augusto von Dentz
0 siblings, 0 replies; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2022-02-01 20:24 UTC (permalink / raw)
To: trix
Cc: Marcel Holtmann, Johan Hedberg, David Miller, Jakub Kicinski,
nathan, ndesaulniers, linux-bluetooth@vger.kernel.org,
open list:NETWORKING [GENERAL], Linux Kernel Mailing List, llvm
Hi Tom,
On Tue, Feb 1, 2022 at 9:43 AM <trix@redhat.com> wrote:
>
> From: Tom Rix <trix@redhat.com>
>
> 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>
> ---
> net/bluetooth/hci_sync.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
> index 6e71aa6b6feae..9327737da6003 100644
> --- a/net/bluetooth/hci_sync.c
> +++ b/net/bluetooth/hci_sync.c
> @@ -4425,7 +4425,7 @@ static int hci_disconnect_all_sync(struct hci_dev *hdev, u8 reason)
> return err;
> }
>
> - return err;
> + return 0;
> }
>
> /* This function perform power off HCI command sequence as follows:
> --
> 2.26.3
Applied, thanks.
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-01 20:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-01 17:42 [PATCH] Bluetooth: hci_sync: fix undefined return of hci_disconnect_all_sync() trix
2022-02-01 20:24 ` Luiz Augusto von Dentz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).