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:
parent
a522a8eeaf
commit
a4b378a583
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user