From dd180c2789133c071cc0fbd16ce5cd68192e9fe9 Mon Sep 17 00:00:00 2001 From: Gaetan Perrot Date: Fri, 27 Jun 2025 01:08:02 +0900 Subject: [PATCH] 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 --- subsys/ipc/ipc_service/lib/icmsg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subsys/ipc/ipc_service/lib/icmsg.c b/subsys/ipc/ipc_service/lib/icmsg.c index 500ca20cde6..e62621c46db 100644 --- a/subsys/ipc/ipc_service/lib/icmsg.c +++ b/subsys/ipc/ipc_service/lib/icmsg.c @@ -436,6 +436,9 @@ int icmsg_open(const struct icmsg_config_t *conf, MAKE_RX_HANDSHAKE(dev_data->local_sid, SID_DISCONNECTED)); } else if (UNBOUND_DISABLED) { ret = initialize_tx_with_sid_disabled(dev_data); + if (ret < 0) { + goto cleanup_and_exit; + } } if (old_state == ICMSG_STATE_OFF && (UNBOUND_ENABLED || UNBOUND_DETECT)) {