mirror of
https://github.com/torvalds/linux.git
synced 2024-11-07 04:32:03 +00:00
4776d38127
This patch moves data allocated using kzalloc to managed data allocated using devm_kzalloc and cleans now unnecessary kfrees in probe and remove functions. Also, linux/device.h is added to make sure the devm_*() routine declarations are unambiguously available. Earlier, in the probe function ctrlpriv was leaked on the failure of ctrl = of_iomap(nprop, 0); as well as on the failure of ctrlpriv->jrpdev = kzalloc(...); . These two bugs have been fixed by the patch. The following Coccinelle semantic patch was used for making the change: identifier p, probefn, removefn; @@ struct platform_driver p = { .probe = probefn, .remove = removefn, }; @prb@ identifier platform.probefn, pdev; expression e, e1, e2; @@ probefn(struct platform_device *pdev, ...) { <+... - e = kzalloc(e1, e2) + e = devm_kzalloc(&pdev->dev, e1, e2) ... ?-kfree(e); ...+> } @rem depends on prb@ identifier platform.removefn; expression e; @@ removefn(...) { <... - kfree(e); ...> } Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> |
||
---|---|---|
.. | ||
amcc | ||
caam | ||
ccp | ||
nx | ||
ux500 | ||
atmel-aes-regs.h | ||
atmel-aes.c | ||
atmel-sha-regs.h | ||
atmel-sha.c | ||
atmel-tdes-regs.h | ||
atmel-tdes.c | ||
bfin_crc.c | ||
bfin_crc.h | ||
geode-aes.c | ||
geode-aes.h | ||
hifn_795x.c | ||
ixp4xx_crypto.c | ||
Kconfig | ||
Makefile | ||
mv_cesa.c | ||
mv_cesa.h | ||
mxs-dcp.c | ||
n2_asm.S | ||
n2_core.c | ||
n2_core.h | ||
omap-aes.c | ||
omap-des.c | ||
omap-sham.c | ||
padlock-aes.c | ||
padlock-sha.c | ||
picoxcell_crypto_regs.h | ||
picoxcell_crypto.c | ||
s5p-sss.c | ||
sahara.c | ||
talitos.c | ||
talitos.h |