mqueue: use to DEBUGASSERT to cover some param check

for the speed improve

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2022-09-09 18:00:06 +08:00 committed by Xiang Xiao
parent a522a8eeaf
commit a4b378a583
1 changed files with 2 additions and 2 deletions

View File

@ -117,6 +117,7 @@ int file_mq_send(FAR struct file *mq, FAR const char *msg, size_t msglen,
/* Now allocate the message. */
mqmsg = nxmq_alloc_msg();
DEBUGASSERT(mqmsg != NULL);
/* Check if the message was successfully allocated */
@ -129,8 +130,7 @@ int file_mq_send(FAR struct file *mq, FAR const char *msg, size_t msglen,
* to be exceeded in that case.
*/
ret = (mqmsg == NULL) ? -ENOMEM :
nxmq_do_send(msgq, mqmsg, msg, msglen, prio);
ret = nxmq_do_send(msgq, mqmsg, msg, msglen, prio);
}
leave_critical_section(flags);