All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_sync: fix undefined return of hci_disconnect_all_sync()
@ 2022-02-01 17:42 trix
  2022-02-01 18:12 ` bluez.test.bot
  2022-02-01 20:24 ` [PATCH] " Luiz Augusto von Dentz
  0 siblings, 2 replies; 3+ 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] 3+ messages in thread

* RE: 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 18:12 ` bluez.test.bot
  2022-02-01 20:24 ` [PATCH] " Luiz Augusto von Dentz
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2022-02-01 18:12 UTC (permalink / raw)
  To: linux-bluetooth, trix

[-- Attachment #1: Type: text/plain, Size: 1097 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=610424

---Test result---

Test Summary:
CheckPatch                    PASS      1.70 seconds
GitLint                       PASS      1.03 seconds
SubjectPrefix                 PASS      0.85 seconds
BuildKernel                   PASS      37.44 seconds
BuildKernel32                 PASS      32.39 seconds
Incremental Build with patchesPASS      44.16 seconds
TestRunner: Setup             PASS      604.98 seconds
TestRunner: l2cap-tester      PASS      16.73 seconds
TestRunner: bnep-tester       PASS      7.82 seconds
TestRunner: mgmt-tester       PASS      129.30 seconds
TestRunner: rfcomm-tester     PASS      9.40 seconds
TestRunner: sco-tester        PASS      9.86 seconds
TestRunner: smp-tester        PASS      9.72 seconds
TestRunner: userchan-tester   PASS      8.10 seconds



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 3+ 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 18:12 ` bluez.test.bot
@ 2022-02-01 20:24 ` Luiz Augusto von Dentz
  1 sibling, 0 replies; 3+ 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,
	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] 3+ messages in thread

end of thread, other threads:[~2022-02-01 20:25 UTC | newest]

Thread overview: 3+ 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 18:12 ` bluez.test.bot
2022-02-01 20:24 ` [PATCH] " Luiz Augusto von Dentz

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.