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:
Tom Hughes <tomhughes@chromium.org>
Loading
Please sign in to comment