Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 59154
b: refs/heads/master
c: e4585da
h: refs/heads/master
v: v3
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Jul 11, 2007
1 parent b4be79a commit 4111322
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 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: a23adb5b2db7f2a0758abfa20b0220dbcbfd7aa9
refs/heads/master: e4585da22ad04a055cbb5c863a37aa8cc02eac89
20 changes: 11 additions & 9 deletions trunk/drivers/pci/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
u8 byte;
u16 word;
u32 dword;
long err, cfg_ret;
long err;
long cfg_ret;

err = -EPERM;
if (!capable(CAP_SYS_ADMIN))
goto error;
return -EPERM;

err = -ENODEV;
dev = pci_find_slot(bus, dfn);
dev = pci_get_bus_and_slot(bus, dfn);
if (!dev)
goto error;

Expand Down Expand Up @@ -66,7 +66,8 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
case 4:
err = put_user(dword, (unsigned int __user *)buf);
break;
};
}
pci_dev_put(dev);
return err;

error:
Expand All @@ -83,7 +84,8 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
case 4:
put_user(-1, (unsigned int __user *)buf);
break;
};
}
pci_dev_put(dev);
return err;
}

Expand All @@ -101,7 +103,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
if (!capable(CAP_SYS_ADMIN))
return -EPERM;

dev = pci_find_slot(bus, dfn);
dev = pci_get_bus_and_slot(bus, dfn);
if (!dev)
return -ENODEV;

Expand Down Expand Up @@ -137,8 +139,8 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
default:
err = -EINVAL;
break;
};
}
unlock_kernel();

pci_dev_put(dev);
return err;
}

0 comments on commit 4111322

Please sign in to comment.