diff options
-rw-r--r-- | drivers/pci/pci-sysfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index ad44557e65c4..6309c5a2528f 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/stat.h> | 21 | #include <linux/stat.h> |
22 | #include <linux/topology.h> | 22 | #include <linux/topology.h> |
23 | #include <linux/mm.h> | 23 | #include <linux/mm.h> |
24 | #include <linux/fs.h> | ||
24 | #include <linux/capability.h> | 25 | #include <linux/capability.h> |
25 | #include <linux/pci-aspm.h> | 26 | #include <linux/pci-aspm.h> |
26 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
@@ -367,7 +368,7 @@ pci_read_config(struct file *filp, struct kobject *kobj, | |||
367 | u8 *data = (u8*) buf; | 368 | u8 *data = (u8*) buf; |
368 | 369 | ||
369 | /* Several chips lock up trying to read undefined config space */ | 370 | /* Several chips lock up trying to read undefined config space */ |
370 | if (capable(CAP_SYS_ADMIN)) { | 371 | if (cap_raised(filp->f_cred->cap_effective, CAP_SYS_ADMIN)) { |
371 | size = dev->cfg_size; | 372 | size = dev->cfg_size; |
372 | } else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) { | 373 | } else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) { |
373 | size = 128; | 374 | size = 128; |