Skip to content

Commit a9279ee

Browse files
Thalleykartben
authored andcommitted
Bluetooth: Controller: Fix coverity issue for cis == NULL
Coverity was unhappy that `struct ll_conn_iso_stream *cis = NULL;` was never assigned to a non-NULL value, which is due to the assignment being guarded by `#if defined(CONFIG_BT_CTLR_CONN_ISO)`. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 4a6e478 commit a9279ee

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

subsys/bluetooth/controller/ll_sw/ull_iso.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
#include <stddef.h>
8+
79
#include <soc.h>
810
#include <zephyr/kernel.h>
911
#include <zephyr/sys/byteorder.h>
1012
#include <zephyr/bluetooth/hci_types.h>
1113
#include <zephyr/bluetooth/buf.h>
14+
#include <zephyr/sys/util_macro.h>
1215

1316
#include "hal/cpu.h"
1417
#include "hal/ccm.h"
@@ -233,10 +236,7 @@ uint8_t ll_setup_iso_path(uint16_t handle, uint8_t path_dir, uint8_t path_id,
233236
ARG_UNUSED(controller_delay);
234237
ARG_UNUSED(codec_config);
235238

236-
if (false) {
237-
238-
#if defined(CONFIG_BT_CTLR_CONN_ISO)
239-
} else if (IS_CIS_HANDLE(handle)) {
239+
if (IS_ENABLED(CONFIG_BT_CTLR_CONN_ISO) && IS_CIS_HANDLE(handle)) {
240240
struct ll_conn_iso_group *cig;
241241
struct ll_conn *conn;
242242

@@ -307,8 +307,6 @@ uint8_t ll_setup_iso_path(uint16_t handle, uint8_t path_dir, uint8_t path_id,
307307
sdu_interval = cig->c_sdu_interval;
308308
}
309309
}
310-
#endif /* CONFIG_BT_CTLR_CONN_ISO */
311-
312310
#if defined(CONFIG_BT_CTLR_ADV_ISO)
313311
} else if (IS_ADV_ISO_HANDLE(handle)) {
314312
struct ll_adv_iso_set *adv_iso;
@@ -450,7 +448,7 @@ uint8_t ll_setup_iso_path(uint16_t handle, uint8_t path_dir, uint8_t path_id,
450448
}
451449

452450
if (!err) {
453-
if (cis) {
451+
if (IS_ENABLED(CONFIG_BT_CTLR_CONN_ISO) && cis != NULL) {
454452
cis->hdr.datapath_out = dp;
455453
}
456454

0 commit comments

Comments
 (0)