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) ...@@ -25,7 +25,7 @@ proc_bus_pci_lseek(struct file *file, loff_t off, int whence)
{ {
loff_t new = -1; loff_t new = -1;
lock_kernel(); down(&file->f_dentry->d_inode->i_sem);
switch (whence) { switch (whence) {
case 0: case 0:
new = off; new = off;
...@@ -37,10 +37,12 @@ proc_bus_pci_lseek(struct file *file, loff_t off, int whence) ...@@ -37,10 +37,12 @@ proc_bus_pci_lseek(struct file *file, loff_t off, int whence)
new = PCI_CFG_SPACE_SIZE + off; new = PCI_CFG_SPACE_SIZE + off;
break; break;
} }
unlock_kernel();
if (new < 0 || new > PCI_CFG_SPACE_SIZE) if (new < 0 || new > PCI_CFG_SPACE_SIZE)
return -EINVAL; new = -EINVAL;
return (file->f_pos = new); else
file->f_pos = new;
up(&file->f_dentry->d_inode->i_sem);
return new;
} }
static ssize_t 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