diff options
-rw-r--r-- | drivers/pci/proc.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c index 48ca9ae29e16..2bf159b9c1cd 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/proc_fs.h> | 12 | #include <linux/proc_fs.h> |
13 | #include <linux/seq_file.h> | 13 | #include <linux/seq_file.h> |
14 | #include <linux/smp_lock.h> | ||
14 | #include <linux/capability.h> | 15 | #include <linux/capability.h> |
15 | #include <asm/uaccess.h> | 16 | #include <asm/uaccess.h> |
16 | #include <asm/byteorder.h> | 17 | #include <asm/byteorder.h> |
@@ -202,15 +203,18 @@ struct pci_filp_private { | |||
202 | int write_combine; | 203 | int write_combine; |
203 | }; | 204 | }; |
204 | 205 | ||
205 | static int proc_bus_pci_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) | 206 | static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, |
207 | unsigned long arg) | ||
206 | { | 208 | { |
207 | const struct proc_dir_entry *dp = PDE(inode); | 209 | const struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); |
208 | struct pci_dev *dev = dp->data; | 210 | struct pci_dev *dev = dp->data; |
209 | #ifdef HAVE_PCI_MMAP | 211 | #ifdef HAVE_PCI_MMAP |
210 | struct pci_filp_private *fpriv = file->private_data; | 212 | struct pci_filp_private *fpriv = file->private_data; |
211 | #endif /* HAVE_PCI_MMAP */ | 213 | #endif /* HAVE_PCI_MMAP */ |
212 | int ret = 0; | 214 | int ret = 0; |
213 | 215 | ||
216 | lock_kernel(); | ||
217 | |||
214 | switch (cmd) { | 218 | switch (cmd) { |
215 | case PCIIOC_CONTROLLER: | 219 | case PCIIOC_CONTROLLER: |
216 | ret = pci_domain_nr(dev->bus); | 220 | ret = pci_domain_nr(dev->bus); |
@@ -239,6 +243,7 @@ static int proc_bus_pci_ioctl(struct inode *inode, struct file *file, unsigned i | |||
239 | break; | 243 | break; |
240 | }; | 244 | }; |
241 | 245 | ||
246 | unlock_kernel(); | ||
242 | return ret; | 247 | return ret; |
243 | } | 248 | } |
244 | 249 | ||
@@ -291,7 +296,7 @@ static const struct file_operations proc_bus_pci_operations = { | |||
291 | .llseek = proc_bus_pci_lseek, | 296 | .llseek = proc_bus_pci_lseek, |
292 | .read = proc_bus_pci_read, | 297 | .read = proc_bus_pci_read, |
293 | .write = proc_bus_pci_write, | 298 | .write = proc_bus_pci_write, |
294 | .ioctl = proc_bus_pci_ioctl, | 299 | .unlocked_ioctl = proc_bus_pci_ioctl, |
295 | #ifdef HAVE_PCI_MMAP | 300 | #ifdef HAVE_PCI_MMAP |
296 | .open = proc_bus_pci_open, | 301 | .open = proc_bus_pci_open, |
297 | .release = proc_bus_pci_release, | 302 | .release = proc_bus_pci_release, |