mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-23 12:43:55 +08:00
d947629891
pci_get_device increments a reference count that should be decremented using pci_dev_put. The semantic patch that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @r exists@ local idexpression x; statement S,S1; position p1,p2,p3; expression E,E1; type T,T1; expression *ptr != NULL; @@ ( if ((x@p1 = pci_get_device(...)) == NULL) S | x@p1 = pci_get_device(...); ) ... when != pci_dev_put(...,(T)x,...) when != if (...) { <+... pci_dev_put(...,(T)x,...) ...+> } when != true x == NULL || ... when != x = E when != E = (T)x when any ( if (x == NULL || ...) S1 | if@p2 (...) { ... when != pci_dev_put(...,(T1)x,...) when != if (...) { <+... pci_dev_put(...,(T1)x,...) ...+> } when != x = E1 when != E1 = (T1)x ( return \(0\|<+...x...+>\|ptr\); | return@p3 ...; ) } ) @ script:python @ p1 << r.p1; p3 << r.p3; @@ print "* file: %s pci_get_device: %s return: %s" % (p1[0].file,p1[0].line,p3[0].line) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> |
||
---|---|---|
.. | ||
alauda.c | ||
ams-delta.c | ||
atmel_nand_ecc.h | ||
atmel_nand.c | ||
au1550nd.c | ||
autcpu12.c | ||
bf5xx_nand.c | ||
cafe_nand.c | ||
cmx270_nand.c | ||
cs553x_nand.c | ||
diskonchip.c | ||
edb7312.c | ||
excite_nandflash.c | ||
fsl_elbc_nand.c | ||
fsl_upm.c | ||
gpio.c | ||
h1910.c | ||
Kconfig | ||
Makefile | ||
mxc_nand.c | ||
nand_base.c | ||
nand_bbt.c | ||
nand_ecc.c | ||
nand_ids.c | ||
nandsim.c | ||
ndfc.c | ||
orion_nand.c | ||
pasemi_nand.c | ||
plat_nand.c | ||
ppchameleonevb.c | ||
pxa3xx_nand.c | ||
rtc_from4.c | ||
s3c2410.c | ||
sh_flctl.c | ||
sharpsl.c | ||
spia.c | ||
tmio_nand.c | ||
ts7250.c |