
Detected with Coverity and fix with braces.
Details:
Code that is meant to be executed conditionally may be executed unconditionally
In do_notify: The indentation of this code suggests it is nested when it is not. (CWE-483)
multi_stmt_macro: The macro on this line expands into multiple statements, only the first of which is nested within the preceding parent while the rest are not.
http://cwe.mitre.org/data/definitions/483.html
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- src/ipc/byt-ipc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/ipc/byt-ipc.c b/src/ipc/byt-ipc.c index 8897bb9..b5da4b6 100644 --- a/src/ipc/byt-ipc.c +++ b/src/ipc/byt-ipc.c @@ -67,8 +67,9 @@ static void do_notify(void) goto out;
/* copy the data returned from DSP */ - if (msg->rx_size && msg->rx_size < SOF_IPC_MSG_MAX_SIZE) + if (msg->rx_size && msg->rx_size < SOF_IPC_MSG_MAX_SIZE) { mailbox_dspbox_read(msg->rx_data, 0, msg->rx_size); + }
/* any callback ? */ if (msg->cb)