diff options
author | Joel Fernandes <joelf@ti.com> | 2013-08-17 22:42:33 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2013-08-21 07:28:05 -0400 |
commit | 05007c10ff76a9d6d85c007fe3a7f531611fda5c (patch) | |
tree | b112cbe59ce5afbe5eb393908546a1d553ecda51 /drivers/crypto | |
parent | 6242332ff2f3431c4fb6f4b21581f38f16569c13 (diff) |
crypto: omap-aes - Convert kzalloc to devm_kzalloc
Use devm_kzalloc instead of kzalloc. With this change, there is no need to
call kfree in error/exit paths.
Signed-off-by: Joel Fernandes <joelf@ti.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/omap-aes.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c index 2fd22ca6a58f..1f3d816cc9e6 100644 --- a/drivers/crypto/omap-aes.c +++ b/drivers/crypto/omap-aes.c | |||
@@ -1158,7 +1158,7 @@ static int omap_aes_probe(struct platform_device *pdev) | |||
1158 | int err = -ENOMEM, i, j, irq = -1; | 1158 | int err = -ENOMEM, i, j, irq = -1; |
1159 | u32 reg; | 1159 | u32 reg; |
1160 | 1160 | ||
1161 | dd = kzalloc(sizeof(struct omap_aes_dev), GFP_KERNEL); | 1161 | dd = devm_kzalloc(dev, sizeof(struct omap_aes_dev), GFP_KERNEL); |
1162 | if (dd == NULL) { | 1162 | if (dd == NULL) { |
1163 | dev_err(dev, "unable to alloc data struct.\n"); | 1163 | dev_err(dev, "unable to alloc data struct.\n"); |
1164 | goto err_data; | 1164 | goto err_data; |
@@ -1251,7 +1251,6 @@ err_irq: | |||
1251 | tasklet_kill(&dd->queue_task); | 1251 | tasklet_kill(&dd->queue_task); |
1252 | pm_runtime_disable(dev); | 1252 | pm_runtime_disable(dev); |
1253 | err_res: | 1253 | err_res: |
1254 | kfree(dd); | ||
1255 | dd = NULL; | 1254 | dd = NULL; |
1256 | err_data: | 1255 | err_data: |
1257 | dev_err(dev, "initialization failed.\n"); | 1256 | dev_err(dev, "initialization failed.\n"); |
@@ -1279,7 +1278,6 @@ static int omap_aes_remove(struct platform_device *pdev) | |||
1279 | tasklet_kill(&dd->queue_task); | 1278 | tasklet_kill(&dd->queue_task); |
1280 | omap_aes_dma_cleanup(dd); | 1279 | omap_aes_dma_cleanup(dd); |
1281 | pm_runtime_disable(dd->dev); | 1280 | pm_runtime_disable(dd->dev); |
1282 | kfree(dd); | ||
1283 | dd = NULL; | 1281 | dd = NULL; |
1284 | 1282 | ||
1285 | return 0; | 1283 | return 0; |