diff --git a/drivers/ipm/ipm_mcux.c b/drivers/ipm/ipm_mcux.c index 176b858f20a..93267f5c58b 100644 --- a/drivers/ipm/ipm_mcux.c +++ b/drivers/ipm/ipm_mcux.c @@ -93,7 +93,7 @@ static int mcux_mailbox_ipm_send(const struct device *d, int wait, return -EINVAL; } - if (size > MCUX_IPM_DATA_REGS * sizeof(uint32_t)) { + if ((size < 0) || (size > MCUX_IPM_DATA_REGS * sizeof(uint32_t))) { return -EMSGSIZE; }