diff options
author | Julia Lawall <julia@diku.dk> | 2008-02-06 01:39:23 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-06 10:41:16 -0800 |
commit | 625fcaf97340b9409e41fcefbbd18e02e3a9e9dd (patch) | |
tree | 3ea04c28d5528132d8aa6975579b04dd6e89013f /lib/plist.c | |
parent | 5eb03a4ab239d8769fa13df6c894d618ecae1b50 (diff) |
drivers/video: add missing pci_dev_get
pci_get_device does a pci_dev_get, so pci_dev_put needs to be called in an
error case
The problem was fixed using the following semantic patch.
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@exists@
type T1,T2;
identifier E;
statement S,S1;
expression x1,x2,x3;
expression test;
int ret != 0;
@@
struct pci_dev *E;
...
(
E = \(pci_get_slot\|pci_get_device\|pci_get_bus_and_slot\)(...);
if (E == NULL) S
|
if ((E = \(pci_get_slot\|pci_get_device\|pci_get_bus_and_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 (E == NULL) S1
|
if (test)
+ {
(
+ pci_dev_put(E);
return;
|
+ pci_dev_put(E);
return ret;
)
+ }
|
if (test) {
... when != pci_dev_put(...,(T2)E,...)
when != if (E != NULL) { ... pci_dev_put(...,(T2)E,...); ...}
when != x2 = (T2)E
(
+ pci_dev_put(E);
return;
|
+ pci_dev_put(E);
return ret;
)
}
)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/plist.c')
0 files changed, 0 insertions, 0 deletions