Skip to content
Commit 14fe06e4 authored by Tom Hughes's avatar Tom Hughes Committed by Benjamin Cabé
Browse files

Bluetooth: ISO: Fix -Wsometimes-uninitialized warning



Building sample.bluetooth.tmap_central with clang warns:

subsys/bluetooth/host/iso.c:2194:6: error: variable 'rsp' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
        if (!advanced) {
            ^~~~~~~~~
subsys/bluetooth/host/iso.c:2202:6: note: uninitialized use occurs here
        if (rsp == NULL) {
            ^~~
subsys/bluetooth/host/iso.c:2194:2: note: remove the 'if' if its
condition is always true
        if (!advanced) {
        ^~~~~~~~~~~~~~~
subsys/bluetooth/host/iso.c:2137:21: note: initialize the variable 'rsp'
to silence this warning
        struct net_buf *rsp;
                           ^
                            = NULL
subsys/bluetooth/host/iso.c:2295:6: error: variable 'rsp' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
        if (!advanced) {
            ^~~~~~~~~
subsys/bluetooth/host/iso.c:2303:6: note: uninitialized use occurs here
        if (rsp == NULL) {
            ^~~
subsys/bluetooth/host/iso.c:2295:2: note: remove the 'if' if its
condition is always true
        if (!advanced) {
        ^~~~~~~~~~~~~~~
subsys/bluetooth/host/iso.c:2258:21: note: initialize the variable 'rsp'
to silence this warning
        struct net_buf *rsp;
                           ^
                            = NULL

Signed-off-by: default avatarTom Hughes <tomhughes@chromium.org>
parent 8c82d00b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment