Signed-off-by: Alan Cox <[EMAIL PROTECTED]>

diff -u --new-file --recursive --exclude-from /usr/src/exclude 
linux.vanilla-2.6.21-rc6-mm1/drivers/pci/syscall.c 
linux-2.6.21-rc6-mm1/drivers/pci/syscall.c
--- linux.vanilla-2.6.21-rc6-mm1/drivers/pci/syscall.c  2007-04-12 
14:14:44.000000000 +0100
+++ linux-2.6.21-rc6-mm1/drivers/pci/syscall.c  2007-04-23 11:43:53.667542736 
+0100
@@ -30,7 +30,7 @@
                goto error;
 
        err = -ENODEV;
-       dev = pci_find_slot(bus, dfn);
+       dev = pci_get_bus_and_slot(bus, dfn);
        if (!dev)
                goto error;
 
@@ -67,6 +67,7 @@
                err = put_user(dword, (unsigned int __user *)buf);
                break;
        };
+       pci_dev_put(dev);
        return err;
 
 error:
@@ -84,6 +85,7 @@
                put_user(-1, (unsigned int __user *)buf);
                break;
        };
+       pci_dev_put(dev);
        return err;
 }
 
@@ -101,7 +103,7 @@
        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;
 
@@ -139,6 +141,6 @@
                break;
        };
        unlock_kernel();
-
+       pci_dev_put(dev);
        return err;
 }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to