From edc21bd50c40f85c25708bd5204a728f4b28905e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Mon, 31 Jul 2023 13:29:43 +0200 Subject: [PATCH] ipc: fix icmsg-me maybe-uninitialized compile warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sent_bytes variable was not initialized in all possible execution branches before return. Signed-off-by: Rafał Kuźnia --- subsys/ipc/ipc_service/lib/icmsg_me.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/ipc/ipc_service/lib/icmsg_me.c b/subsys/ipc/ipc_service/lib/icmsg_me.c index c836d71b7b4..870dca0d483 100644 --- a/subsys/ipc/ipc_service/lib/icmsg_me.c +++ b/subsys/ipc/ipc_service/lib/icmsg_me.c @@ -168,7 +168,7 @@ int icmsg_me_send(const struct icmsg_config_t *conf, const void *msg, size_t len) { int r; - int sent_bytes; + int sent_bytes = 0; if (user_buffer_len_to_icmsg_buffer_len(len) >= SEND_BUF_SIZE) { return -EBADMSG;