Commit 1b6f967a authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] remove lock_kernel() from proc_bus_pci_lseek()

Remove pointless lock_kernel(), replace with the standard-but-still-odd
i_sem-based lseek locking.
parent 4617516d
......@@ -25,7 +25,7 @@ proc_bus_pci_lseek(struct file *file, loff_t off, int whence)
{
loff_t new = -1;
lock_kernel();
down(&file->f_dentry->d_inode->i_sem);
switch (whence) {
case 0:
new = off;
......@@ -37,10 +37,12 @@ proc_bus_pci_lseek(struct file *file, loff_t off, int whence)
new = PCI_CFG_SPACE_SIZE + off;
break;
}
unlock_kernel();
if (new < 0 || new > PCI_CFG_SPACE_SIZE)
return -EINVAL;
return (file->f_pos = new);
new = -EINVAL;
else
file->f_pos = new;
up(&file->f_dentry->d_inode->i_sem);
return new;
}
static ssize_t
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment