summaryrefslogtreecommitdiff
path: root/nuttx/fs/mqueue
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-09-29 16:13:07 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-09-29 16:13:07 -0600
commit30614ceb7173fb664204daa41b5fa19538a4d7bd (patch)
treeaf7b3e7a8ec69f47980b85828c05c129e2fe2367 /nuttx/fs/mqueue
parent5160874dedc96959f4f1e68f32c6a634568c539e (diff)
downloadpx4-nuttx-30614ceb7173fb664204daa41b5fa19538a4d7bd.tar.gz
px4-nuttx-30614ceb7173fb664204daa41b5fa19538a4d7bd.tar.bz2
px4-nuttx-30614ceb7173fb664204daa41b5fa19538a4d7bd.zip
Fix some unbalanced sched_lock()/sched_unlock() pairs int the re-implemented VFS semaphore and message queue logic
Diffstat (limited to 'nuttx/fs/mqueue')
-rw-r--r--nuttx/fs/mqueue/mq_close.c1
-rw-r--r--nuttx/fs/mqueue/mq_open.c3
-rw-r--r--nuttx/fs/mqueue/mq_unlink.c2
3 files changed, 5 insertions, 1 deletions
diff --git a/nuttx/fs/mqueue/mq_close.c b/nuttx/fs/mqueue/mq_close.c
index 7df2d8a26..e1c8c1438 100644
--- a/nuttx/fs/mqueue/mq_close.c
+++ b/nuttx/fs/mqueue/mq_close.c
@@ -150,6 +150,7 @@ int mq_close(mqd_t mqdes)
/* Decrement the reference count on the inode */
mq_inode_release(inode);
+ sched_unlock();
}
return OK;
diff --git a/nuttx/fs/mqueue/mq_open.c b/nuttx/fs/mqueue/mq_open.c
index 595adeb97..8588ebb73 100644
--- a/nuttx/fs/mqueue/mq_open.c
+++ b/nuttx/fs/mqueue/mq_open.c
@@ -235,9 +235,10 @@ mqd_t mq_open(const char *mq_name, int oflags, ...)
inode->u.i_mqueue = msgq;
msgq->inode = inode;
}
+
+ sched_unlock();
}
- sched_unlock();
return mqdes;
errout_with_msgq:
diff --git a/nuttx/fs/mqueue/mq_unlink.c b/nuttx/fs/mqueue/mq_unlink.c
index 2caf0df6b..496571163 100644
--- a/nuttx/fs/mqueue/mq_unlink.c
+++ b/nuttx/fs/mqueue/mq_unlink.c
@@ -160,6 +160,7 @@ int mq_unlink(FAR const char *mq_name)
inode_semgive();
mq_inode_release(inode);
+ sched_unlock();
return OK;
errout_with_semaphore:
@@ -168,5 +169,6 @@ errout_with_inode:
inode_release(inode);
errout:
set_errno(errcode);
+ sched_unlock();
return ERROR;
}