summaryrefslogtreecommitdiff
path: root/drivers/pci/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/syscall.c')
-rw-r--r--drivers/pci/syscall.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c
index 7958250856d3..f602176eb8b0 100644
--- a/drivers/pci/syscall.c
+++ b/drivers/pci/syscall.c
@@ -23,8 +23,10 @@ SYSCALL_DEFINE5(pciconfig_read, unsigned long, bus, unsigned long, dfn,
long err;
int cfg_ret;
+ err = -EPERM;
+ dev = NULL;
if (!capable(CAP_SYS_ADMIN))
- return -EPERM;
+ goto error;
err = -ENODEV;
dev = pci_get_bus_and_slot(bus, dfn);