Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8ea50a3f0b70977939d2d9d3671b8173482afff2
Commit:     8ea50a3f0b70977939d2d9d3671b8173482afff2
Parent:     b64d70825abbf706bbe80be1b11b09514b71f45e
Author:     Julia Lawall <[EMAIL PROTECTED]>
AuthorDate: Wed Nov 28 16:21:36 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Nov 29 09:24:52 2007 -0800

    drivers/pnp/resource.c: Add missing pci_dev_put
    
    There should be a pci_dev_put when breaking out of a loop that iterates
    over calls to pci_get_device and similar functions.
    
    This was fixed using the following semantic patch.
    
    // <smpl>
    @@
    identifier d;
    type T;
    expression e;
    iterator for_each_pci_dev;
    @@
    
    T *d;
    ...
    for_each_pci_dev(d)
       {... when != pci_dev_put(d)
            when != e = d
    (
        return d;
    |
    +  pci_dev_put(d);
    ?  return ...;
    )
    ...}
    // </smpl>
    
    Signed-off-by: Julia Lawall <[EMAIL PROTECTED]>
    Cc: Greg KH <[EMAIL PROTECTED]>
    Cc: Bjorn Helgaas <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/pnp/resource.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
index 41d73a5..e50ebcf 100644
--- a/drivers/pnp/resource.c
+++ b/drivers/pnp/resource.c
@@ -367,8 +367,10 @@ int pnp_check_irq(struct pnp_dev *dev, int idx)
        {
                struct pci_dev *pci = NULL;
                for_each_pci_dev(pci) {
-                       if (pci->irq == *irq)
+                       if (pci->irq == *irq) {
+                               pci_dev_put(pci);
                                return 0;
+                       }
                }
        }
 #endif
-
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