Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pci syscall.c: Switch to refcounting API

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Alan Cox and committed by
Greg Kroah-Hartman
e4585da2 a23adb5b

+11 -9
+11 -9
drivers/pci/syscall.c
··· 23 23 u8 byte; 24 24 u16 word; 25 25 u32 dword; 26 - long err, cfg_ret; 26 + long err; 27 + long cfg_ret; 27 28 28 - err = -EPERM; 29 29 if (!capable(CAP_SYS_ADMIN)) 30 - goto error; 30 + return -EPERM; 31 31 32 32 err = -ENODEV; 33 - dev = pci_find_slot(bus, dfn); 33 + dev = pci_get_bus_and_slot(bus, dfn); 34 34 if (!dev) 35 35 goto error; 36 36 ··· 66 66 case 4: 67 67 err = put_user(dword, (unsigned int __user *)buf); 68 68 break; 69 - }; 69 + } 70 + pci_dev_put(dev); 70 71 return err; 71 72 72 73 error: ··· 84 83 case 4: 85 84 put_user(-1, (unsigned int __user *)buf); 86 85 break; 87 - }; 86 + } 87 + pci_dev_put(dev); 88 88 return err; 89 89 } 90 90 ··· 103 101 if (!capable(CAP_SYS_ADMIN)) 104 102 return -EPERM; 105 103 106 - dev = pci_find_slot(bus, dfn); 104 + dev = pci_get_bus_and_slot(bus, dfn); 107 105 if (!dev) 108 106 return -ENODEV; 109 107 ··· 139 137 default: 140 138 err = -EINVAL; 141 139 break; 142 - }; 140 + } 143 141 unlock_kernel(); 144 - 142 + pci_dev_put(dev); 145 143 return err; 146 144 }