Skip to content

Commit 0663aa2

Browse files
rugeGerritsenrlubos
authored andcommitted
bluetooth: Initialize conn to NULL for bt_conn_le_create()
After zephyrproject-rtos/zephyr#79856 a warning message is printed out if the connection object is not initialized to NULL. This commit addresses this by initialing it. Signed-off-by: Rubin Gerritsen <[email protected]> (cherry picked from commit 86f1953)
1 parent c7370fc commit 0663aa2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

subsys/bluetooth/rpc/host/bt_rpc_conn_host.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ static void bt_conn_le_create_rpc_handler(const struct nrf_rpc_group *group,
555555
const bt_addr_le_t *peer;
556556
struct bt_conn_le_create_param create_param;
557557
struct bt_le_conn_param conn_param;
558-
struct bt_conn *conn_data;
558+
struct bt_conn *conn_data = NULL;
559559
struct bt_conn **conn = &conn_data;
560560
size_t buffer_size_max = 8;
561561

subsys/bluetooth/scan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ static void scan_connect_with_target(struct bt_scan_control *control,
483483
}
484484

485485
/* Establish connection. */
486-
struct bt_conn *conn;
486+
struct bt_conn *conn = NULL;
487487

488488
/* Stop scanning. */
489489
bt_scan_stop();

0 commit comments

Comments
 (0)