From: Julia Lawall Date: Tue, 5 Feb 2008 06:27:46 +0000 (-0800) Subject: drivers/pcmcia: add missing pci_dev_get X-Git-Tag: v2.6.25-rc1~1027 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1523508d6321436b6edfcd99aab04a344f9aed3f;p=pandora-kernel.git drivers/pcmcia: add missing pci_dev_get pci_get_slot does a pci_dev_get, so pci_dev_put needs to be called in an error case. An extract of the semantic match used to find the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ type find1.T,T1,T2; identifier find1.E; statement find1.S; expression x1,x2,x3; expression find1.test; int ret != 0; @@ T E; ... ( * E = pci_get_slot(...); if (E == NULL) S | * if ((E = pci_get_slot(...)) == NULL) S ) ... when != pci_dev_put(...,(T1)E,...) when != if (E != NULL) { ... pci_dev_put(...,(T1)E,...); ...} when != x1 = (T1)E when != E = x3; when any if (test) { ... when != pci_dev_put(...,(T2)E,...) when != if (E != NULL) { ... pci_dev_put(...,(T2)E,...); ...} when != x2 = (T2)E ( * return; | * return ret; ) } // Signed-off-by: Julia Lawall Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed