Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207870
b: refs/heads/master
c: d50ac46
h: refs/heads/master
v: v3
  • Loading branch information
Geert Uytterhoeven committed Aug 9, 2010
1 parent d7f846e commit 965a52d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d643e2d2cc1d1f37751a99a7c4cb30064cc68aac
refs/heads/master: d50ac468dd023db32c9455b2df56237caf601cbd
15 changes: 8 additions & 7 deletions trunk/drivers/zorro/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ static loff_t
proc_bus_zorro_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;
Expand All @@ -35,12 +36,12 @@ proc_bus_zorro_lseek(struct file *file, loff_t off, int whence)
new = sizeof(struct ConfigDev) + off;
break;
}
if (new < 0 || new > sizeof(struct ConfigDev)) {
unlock_kernel();
return -EINVAL;
}
unlock_kernel();
return (file->f_pos = new);
if (new < 0 || new > sizeof(struct ConfigDev))
new = -EINVAL;
else
file->f_pos = new;
mutex_unlock(&inode->i_mutex);
return new;
}

static ssize_t
Expand Down

0 comments on commit 965a52d

Please sign in to comment.