mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
fs/inode: add sanity check for inode
Change-Id: Ib2c74ba308b8f15756fac4e69632c296243eb4ab Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
@@ -106,11 +106,10 @@ int mq_notify(mqd_t mqdes, FAR const struct sigevent *notification)
|
||||
}
|
||||
|
||||
inode = filep->f_inode;
|
||||
msgq = inode->i_private;
|
||||
|
||||
/* Was a valid message queue descriptor provided? */
|
||||
|
||||
if (!msgq)
|
||||
if (!inode || !inode->i_private)
|
||||
{
|
||||
/* No.. return EBADF */
|
||||
|
||||
@@ -128,6 +127,7 @@ int mq_notify(mqd_t mqdes, FAR const struct sigevent *notification)
|
||||
|
||||
/* Is there already a notification attached */
|
||||
|
||||
msgq = inode->i_private;
|
||||
if (msgq->ntpid == INVALID_PROCESS_ID)
|
||||
{
|
||||
/* No... Have we been asked to establish one? */
|
||||
|
||||
Reference in New Issue
Block a user