From 717c25953fbebd3c9cdc76a5df323ca1558389d0 Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Thu, 15 May 2008 09:11:26 -0600 Subject: [PATCH] --- yaml --- r: 100266 b: refs/heads/master c: 1fa984b583a809423ddb1d88fa46484071f85f80 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/sh/boards/landisk/gio.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 8fa4cd97a2ca..3a0864de6420 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7558da942e51933b5e6aa5e851d4da1df0cd6752 +refs/heads/master: 1fa984b583a809423ddb1d88fa46484071f85f80 diff --git a/trunk/arch/sh/boards/landisk/gio.c b/trunk/arch/sh/boards/landisk/gio.c index 17025080db35..0c15b0a50b99 100644 --- a/trunk/arch/sh/boards/landisk/gio.c +++ b/trunk/arch/sh/boards/landisk/gio.c @@ -14,6 +14,7 @@ */ #include #include +#include #include #include #include @@ -32,17 +33,20 @@ static int openCnt; static int gio_open(struct inode *inode, struct file *filp) { int minor; + int ret = -ENOENT; + lock_kernel(); minor = MINOR(inode->i_rdev); if (minor < DEVCOUNT) { if (openCnt > 0) { - return -EALREADY; + ret = -EALREADY; } else { openCnt++; - return 0; + ret = 0; } } - return -ENOENT; + unlock_kernel(); + return ret; } static int gio_close(struct inode *inode, struct file *filp)