lkml.org 
[lkml]   [2023]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Bluetooth: hci_conn: Refactor hci_bind_bis() since it always succeeds
On Fri, Jan 27, 2023 at 04:51:54PM -0800, Kees Cook wrote:
> The compiler thinks "conn" might be NULL after a call to hci_bind_bis(),
> which cannot happen. Avoid any confusion by just making it not return a
> value since it cannot fail. Fixes the warnings seen with GCC 13:
>
> In function 'arch_atomic_dec_and_test',
> inlined from 'atomic_dec_and_test' at ../include/linux/atomic/atomic-instrumented.h:576:9,
> inlined from 'hci_conn_drop' at ../include/net/bluetooth/hci_core.h:1391:6,
> inlined from 'hci_connect_bis' at ../net/bluetooth/hci_conn.c:2124:3:
> ../arch/x86/include/asm/rmwcc.h:37:9: warning: array subscript 0 is outside array bounds of 'atomic_t[0]' [-Warray-bounds=]
> 37 | asm volatile (fullop CC_SET(cc) \
> | ^~~
> ...
> In function 'hci_connect_bis':
> cc1: note: source object is likely at address zero
>
> Fixes: eca0ae4aea66 ("Bluetooth: Add initial implementation of BIS connections")
...
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> net/bluetooth/hci_conn.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)

Is this really a 'fix' ?

In any case, the change looks good to me.

Reviewed-by: Simon Horman <simon.horman@corigine.com>

\
 
 \ /
  Last update: 2023-03-27 00:00    [W:0.059 / U:1.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site