Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e4585da22ad04a055cbb5c863a37aa8cc02eac89
Commit:     e4585da22ad04a055cbb5c863a37aa8cc02eac89
Parent:     a23adb5b2db7f2a0758abfa20b0220dbcbfd7aa9
Author:     Alan Cox <[EMAIL PROTECTED]>
AuthorDate: Mon Apr 23 14:57:37 2007 +0100
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Wed Jul 11 16:02:07 2007 -0700

    pci syscall.c: Switch to refcounting API
    
    Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/pci/syscall.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c
index 9d37fec..2ac050d 100644
--- a/drivers/pci/syscall.c
+++ b/drivers/pci/syscall.c
@@ -23,14 +23,14 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
        u8 byte;
        u16 word;
        u32 dword;
-       long err, cfg_ret;
+       long err;
+       long cfg_ret;
 
-       err = -EPERM;
        if (!capable(CAP_SYS_ADMIN))
-               goto error;
+               return -EPERM;
 
        err = -ENODEV;
-       dev = pci_find_slot(bus, dfn);
+       dev = pci_get_bus_and_slot(bus, dfn);
        if (!dev)
                goto error;
 
@@ -66,7 +66,8 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
        case 4:
                err = put_user(dword, (unsigned int __user *)buf);
                break;
-       };
+       }
+       pci_dev_put(dev);
        return err;
 
 error:
@@ -83,7 +84,8 @@ error:
        case 4:
                put_user(-1, (unsigned int __user *)buf);
                break;
-       };
+       }
+       pci_dev_put(dev);
        return err;
 }
 
@@ -101,7 +103,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
        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;
 
@@ -137,8 +139,8 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
        default:
                err = -EINVAL;
                break;
-       };
+       }
        unlock_kernel();
-
+       pci_dev_put(dev);
        return err;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to