lkml.org 
[lkml]   [2010]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 04/18] isapnp: BKL removal
From
On Tue, Sep 14, 2010 at 8:40 PM, Arnd Bergmann <arnd@arndb.de> wrote:

> diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c
> index 3f94eda..4249999 100644
> --- a/drivers/pnp/isapnp/proc.c
> +++ b/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;
> @@ -45,11 +46,11 @@ static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence)
>                break;
>        }
>        if (new < 0 || new > 256) {

Mismatched brackets here?

> -               unlock_kernel();
> -               return -EINVAL;
> -       }
> -       unlock_kernel();
> -       return (file->f_pos = new);
> +               new = -EINVAL;
> +       else
> +               file->f_pos = new;
> +       mutex_unlock(&inode->i_mutex);
> +       return new;
>  }
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-09-15 11:33    [W:0.509 / U:0.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site