mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
mq_msgqalloc:del check MQ_MAX_MSGS
N/A Signed-off-by: anjiahao <anjiahao@xiaomi.com> Change-Id: I229e9af7d96b3264bf6e7621644d34a7a9088b69
This commit is contained in:
@@ -68,10 +68,8 @@ int nxmq_alloc_msgq(FAR struct mq_attr *attr,
|
||||
* larger than the configured maximum message size.
|
||||
*/
|
||||
|
||||
DEBUGASSERT((!attr || (attr->mq_msgsize <= MQ_MAX_BYTES &&
|
||||
attr->mq_maxmsg <= MQ_MAX_MSGS)) && msgq);
|
||||
if ((attr && (attr->mq_msgsize > MQ_MAX_BYTES ||
|
||||
attr->mq_maxmsg > MQ_MAX_MSGS)) || !msgq)
|
||||
DEBUGASSERT((!attr || attr->mq_msgsize <= MQ_MAX_BYTES) && msgq);
|
||||
if ((attr && attr->mq_msgsize > MQ_MAX_BYTES) || !msgq)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user