aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2007-11-28 19:21:36 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-29 12:24:52 -0500
commit8ea50a3f0b70977939d2d9d3671b8173482afff2 (patch)
treea4ee35119da225174d672618aecf4a507d6cbd5d
parentb64d70825abbf706bbe80be1b11b09514b71f45e (diff)
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 <julia@diku.dk> Cc: Greg KH <greg@kroah.com> Cc: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/pnp/resource.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
index 41d73a5e9312..e50ebcffb962 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)
367 { 367 {
368 struct pci_dev *pci = NULL; 368 struct pci_dev *pci = NULL;
369 for_each_pci_dev(pci) { 369 for_each_pci_dev(pci) {
370 if (pci->irq == *irq) 370 if (pci->irq == *irq) {
371 pci_dev_put(pci);
371 return 0; 372 return 0;
373 }
372 } 374 }
373 } 375 }
374#endif 376#endif