diff options
| -rw-r--r-- | drivers/pnp/isapnp/proc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c index 3f94edab25fa..e73ebefdf3e0 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; | |||
| 31 | static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence) | 31 | static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence) |
| 32 | { | 32 | { |
| 33 | loff_t new = -1; | 33 | loff_t new = -1; |
| 34 | struct inode *inode = file->f_path.dentry->d_inode; | ||
| 34 | 35 | ||
| 35 | lock_kernel(); | 36 | mutex_lock(&inode->i_mutex); |
| 36 | switch (whence) { | 37 | switch (whence) { |
| 37 | case 0: | 38 | case 0: |
| 38 | new = off; | 39 | new = off; |
| @@ -44,12 +45,12 @@ static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence) | |||
| 44 | new = 256 + off; | 45 | new = 256 + off; |
| 45 | break; | 46 | break; |
| 46 | } | 47 | } |
| 47 | if (new < 0 || new > 256) { | 48 | if (new < 0 || new > 256) |
| 48 | unlock_kernel(); | 49 | new = -EINVAL; |
| 49 | return -EINVAL; | 50 | else |
| 50 | } | 51 | file->f_pos = new; |
| 51 | unlock_kernel(); | 52 | mutex_unlock(&inode->i_mutex); |
| 52 | return (file->f_pos = new); | 53 | return new; |
| 53 | } | 54 | } |
| 54 | 55 | ||
| 55 | static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf, | 56 | static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf, |
