summaryrefslogtreecommitdiffstats
path: root/fs/fifo.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fifo.c')
-rw-r--r--fs/fifo.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/fifo.c b/fs/fifo.c
index 25a08e757..ee048ac02 100644
--- a/fs/fifo.c
+++ b/fs/fifo.c
@@ -11,6 +11,7 @@
#include <linux/mm.h>
#include <linux/malloc.h>
+#include <linux/smp_lock.h>
static void wait_for_partner(struct inode* inode, unsigned int* cnt)
{
@@ -32,6 +33,7 @@ static int fifo_open(struct inode *inode, struct file *filp)
int ret;
ret = -ERESTARTSYS;
+ lock_kernel();
if (down_interruptible(PIPE_SEM(*inode)))
goto err_nolock_nocleanup;
@@ -114,6 +116,7 @@ static int fifo_open(struct inode *inode, struct file *filp)
/* Ok! */
up(PIPE_SEM(*inode));
+ unlock_kernel();
return 0;
err_rd:
@@ -140,6 +143,7 @@ err_nocleanup:
up(PIPE_SEM(*inode));
err_nolock_nocleanup:
+ unlock_kernel();
return ret;
}