Skip to content

Commit 57b99f5

Browse files
lylezhu2012fabiobaltieri
authored andcommitted
Bluetooth: Classic: RFCOMM: Fix unchecked returned value issue
Check the return code of the function `bt_l2cap_br_server_register()`. Fix #100016 Signed-off-by: Lyle Zhu <[email protected]>
1 parent b545d58 commit 57b99f5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

subsys/bluetooth/host/classic/rfcomm.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1866,6 +1866,10 @@ void bt_rfcomm_init(void)
18661866
.accept = rfcomm_accept,
18671867
.sec_level = BT_SECURITY_L1,
18681868
};
1869+
__maybe_unused int err;
18691870

1870-
bt_l2cap_br_server_register(&server);
1871+
err = bt_l2cap_br_server_register(&server);
1872+
if (err != 0) {
1873+
LOG_ERR("Failed to register L2CAP server for RFCOMM (err %d)", err);
1874+
}
18711875
}

0 commit comments

Comments
 (0)