Skip to content

Commit

Permalink
PCI: remove unneeded lock_kernel() in drivers/pci/syscall.c.
Browse files Browse the repository at this point in the history
sys_pciconfig_{read,write}() are protected against PCI removal with the
reference count in struct pci_dev.  The concurrency of
pci_user_{read,write}_config_* functions are already protected by pci_lock
in drivers/pci/access.c.

Signed-off-by: Diego Woitasen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
diegows authored and gregkh committed Feb 1, 2008
1 parent 10d7425 commit 0741a95
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions drivers/pci/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
if (!dev)
goto error;

lock_kernel();
switch (len) {
case 1:
cfg_ret = pci_user_read_config_byte(dev, off, &byte);
Expand All @@ -47,10 +46,8 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
break;
default:
err = -EINVAL;
unlock_kernel();
goto error;
};
unlock_kernel();

err = -EIO;
if (cfg_ret != PCIBIOS_SUCCESSFUL)
Expand Down Expand Up @@ -107,7 +104,6 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
if (!dev)
return -ENODEV;

lock_kernel();
switch(len) {
case 1:
err = get_user(byte, (u8 __user *)buf);
Expand Down Expand Up @@ -140,7 +136,6 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
err = -EINVAL;
break;
}
unlock_kernel();
pci_dev_put(dev);
return err;
}

0 comments on commit 0741a95

Please sign in to comment.