Skip to content

Commit dd180c2

Browse files
moonlight83340dkalowsk
authored andcommitted
ipc_service: ipc_icbmsg: fix unchecked error in icmsg_open()
Coverity (CID 516253) reported that the return value of initialize_tx_with_sid_disabled() was set but not used, leading to potential silent failures. Check if the return value is negative and propagate the error through the existing cleanup path. Fixes: CID 516253 Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
1 parent e4e8870 commit dd180c2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

subsys/ipc/ipc_service/lib/icmsg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,9 @@ int icmsg_open(const struct icmsg_config_t *conf,
436436
MAKE_RX_HANDSHAKE(dev_data->local_sid, SID_DISCONNECTED));
437437
} else if (UNBOUND_DISABLED) {
438438
ret = initialize_tx_with_sid_disabled(dev_data);
439+
if (ret < 0) {
440+
goto cleanup_and_exit;
441+
}
439442
}
440443

441444
if (old_state == ICMSG_STATE_OFF && (UNBOUND_ENABLED || UNBOUND_DETECT)) {

0 commit comments

Comments
 (0)