aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/zorro/proc.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/zorro/proc.c b/drivers/zorro/proc.c
index 3c7046d79654..4f4ea88fbb71 100644
--- a/drivers/zorro/proc.c
+++ b/drivers/zorro/proc.c
@@ -22,8 +22,9 @@ static loff_t
22proc_bus_zorro_lseek(struct file *file, loff_t off, int whence) 22proc_bus_zorro_lseek(struct file *file, loff_t off, int whence)
23{ 23{
24 loff_t new = -1; 24 loff_t new = -1;
25 struct inode *inode = file->f_path.dentry->d_inode;
25 26
26 lock_kernel(); 27 mutex_lock(&inode->i_mutex);
27 switch (whence) { 28 switch (whence) {
28 case 0: 29 case 0:
29 new = off; 30 new = off;
@@ -35,12 +36,12 @@ proc_bus_zorro_lseek(struct file *file, loff_t off, int whence)
35 new = sizeof(struct ConfigDev) + off; 36 new = sizeof(struct ConfigDev) + off;
36 break; 37 break;
37 } 38 }
38 if (new < 0 || new > sizeof(struct ConfigDev)) { 39 if (new < 0 || new > sizeof(struct ConfigDev))
39 unlock_kernel(); 40 new = -EINVAL;
40 return -EINVAL; 41 else
41 } 42 file->f_pos = new;
42 unlock_kernel(); 43 mutex_unlock(&inode->i_mutex);
43 return (file->f_pos = new); 44 return new;
44} 45}
45 46
46static ssize_t 47static ssize_t