linux/drivers/crypto
Himangi Saraogi 4776d38127 crypto: caam - Introduce the use of the managed version of kzalloc
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>
2014-06-20 21:26:06 +08:00
..
amcc crypto: crypto4xx - Remove redundant dev_set_drvdata 2013-12-30 20:19:15 +08:00
caam crypto: caam - Introduce the use of the managed version of kzalloc 2014-06-20 21:26:06 +08:00
ccp crypto: ccp - tfm->__crt_alg->cra_name directly 2014-05-22 21:03:13 +08:00
nx Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6 into next 2014-06-07 19:44:40 -07:00
ux500 crypto: ux500 - Fix logging, make arrays const, neatening 2013-08-01 10:53:59 +10:00
atmel-aes-regs.h crypto: atmel - add Atmel AES driver 2012-07-11 11:07:40 +08:00
atmel-aes.c crypto: atmel-aes - check alignment of cfb64 mode 2014-04-28 18:21:19 +08:00
atmel-sha-regs.h crypto: atmel-sha - add support for latest release of the IP (0x410) 2013-03-10 16:46:42 +08:00
atmel-sha.c crypto: atmel-sha - add sha information to the log 2013-12-12 18:39:36 +01:00
atmel-tdes-regs.h crypto: atmel-tdes - add support for latest release of the IP (0x700) 2013-03-10 16:46:42 +08:00
atmel-tdes.c crypto: atmel-tdes - add support for Device Tree 2013-12-12 18:39:35 +01:00
bfin_crc.c cryptoo: bfin_crc - avoid get physical address of coherence memory by dma_map_single 2014-04-16 20:40:16 +08:00
bfin_crc.h crypto: bfin_crc - access crc registers by readl and writel functions 2014-04-16 20:40:15 +08:00
geode-aes.c crypto: geode - Don't use tfm->__crt_alg->cra_name directly 2014-05-22 21:03:13 +08:00
geode-aes.h crypto: geode - Consistently use AES_KEYSIZE_128 2014-05-22 21:03:12 +08:00
hifn_795x.c crypto: hifn_795x - Pass correct pointer to free_irq() 2013-05-28 15:43:04 +08:00
ixp4xx_crypto.c crypto: ixp4xx - Fix kernel compile error 2014-01-01 14:06:23 +08:00
Kconfig crypto/nx: disable NX on little endian builds 2014-06-11 17:03:19 +10:00
Makefile crypto: tegra - remove driver 2014-02-27 05:56:57 +08:00
mv_cesa.c crypto: cesa - tfm->__crt_alg->cra_type directly 2014-05-22 21:03:17 +08:00
mv_cesa.h crypto: mv_cesa - Add sha1 and hmac(sha1) async hash drivers 2010-04-13 16:50:49 +08:00
mxs-dcp.c crypto: dcp - tfm->__crt_alg->cra_name directly 2014-05-22 21:03:15 +08:00
n2_asm.S crypto: n2 - Add Niagara2 crypto driver 2010-05-19 14:14:04 +10:00
n2_core.c crypto: n2 - tfm->__crt_alg->cra_name directly 2014-05-22 21:03:15 +08:00
n2_core.h crypto: n2 - Add Niagara2 crypto driver 2010-05-19 14:14:04 +10:00
omap-aes.c crypto: omap-aes - Use SIMPLE_DEV_PM_OPS macro 2014-03-10 20:13:38 +08:00
omap-des.c crypto: omap-des - handle error of pm_runtime_get_sync 2014-04-16 20:40:19 +08:00
omap-sham.c crypto: omap-sham - Map SG pages if they are HIGHMEM before accessing 2014-03-10 20:17:13 +08:00
padlock-aes.c crypto: drivers - remove cra_list initialization 2012-08-01 17:47:28 +08:00
padlock-sha.c crypto: padlock - tfm->__crt_alg->cra_name directly 2014-05-22 21:03:16 +08:00
picoxcell_crypto_regs.h crypto: picoxcell - add support for the picoxcell crypto engines 2011-02-21 22:42:40 +11:00
picoxcell_crypto.c crypto: picoxcell - Use devm_ioremap_resource() 2014-02-27 05:56:47 +08:00
s5p-sss.c crypto: s5p-sss - fix multiplatform build 2014-05-13 19:43:45 +08:00
sahara.c crypto: sahara - tfm->__crt_alg->cra_name directly 2014-05-22 21:03:16 +08:00
talitos.c crypto: talitos: init the priv->alg_list more earlier in talitos_probe() 2014-02-09 09:59:25 +08:00
talitos.h crypto: talitos - add sha224, sha384 and sha512 to existing AEAD algorithms 2012-07-11 11:08:29 +08:00