From d40b2d391e6bb7fc86bf8122c918f5e9b295acde Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Sat, 5 Jun 2010 13:28:09 +0200 Subject: [PATCH] --- yaml --- r: 212917 b: refs/heads/master c: 6117d2130c9da5977e975ad9fa607b86d6516a44 h: refs/heads/master i: 212915: 871d02994676cb5d96a2b27ebee6d557aa129457 v: v3 --- [refs] | 2 +- trunk/drivers/pnp/isapnp/proc.c | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index c69555bd8b80..2af73644e21b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cfdb00a77ea7d5fb922fd985e5dfbcb36873411b +refs/heads/master: 6117d2130c9da5977e975ad9fa607b86d6516a44 diff --git a/trunk/drivers/pnp/isapnp/proc.c b/trunk/drivers/pnp/isapnp/proc.c index 3f94edab25fa..e73ebefdf3e0 100644 --- a/trunk/drivers/pnp/isapnp/proc.c +++ b/trunk/drivers/pnp/isapnp/proc.c @@ -31,8 +31,9 @@ static struct proc_dir_entry *isapnp_proc_bus_dir = NULL; static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence) { loff_t new = -1; + struct inode *inode = file->f_path.dentry->d_inode; - lock_kernel(); + mutex_lock(&inode->i_mutex); switch (whence) { case 0: new = off; @@ -44,12 +45,12 @@ static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence) new = 256 + off; break; } - if (new < 0 || new > 256) { - unlock_kernel(); - return -EINVAL; - } - unlock_kernel(); - return (file->f_pos = new); + if (new < 0 || new > 256) + new = -EINVAL; + else + file->f_pos = new; + mutex_unlock(&inode->i_mutex); + return new; } static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf,