| /// Find missing pci_free_consistent for every pci_alloc_consistent. |
| // Copyright: (C) 2013 Petr Strnad. GPLv2. |
| // URL: http://coccinelle.lip6.fr/ |
| // Keywords: pci_free_consistent, pci_alloc_consistent |
| // Options: --no-includes --include-headers |
| id = pci_alloc_consistent@p1(x,y,&z) |
| if (id == NULL || ...) { ... return ...; } |
| ... when != pci_free_consistent(x,y,id,z) |
| when != if (id) { ... pci_free_consistent(x,y,id,z) ... } |
| when != if (y) { ... pci_free_consistent(x,y,id,z) ... } |
| @script:python depends on report@ |
| msg = "ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s" % (p1[0].line,p2[0].line) |
| coccilib.report.print_report(p2[0],msg) |
| @script:python depends on org@ |
| msg = "ERROR: missing pci_free_consistent; pci_alloc_consistent on line %s and return without freeing on line %s" % (p1[0].line,p2[0].line) |