diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2018-02-15 05:38:30 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-02-22 09:17:00 -0500 |
commit | 0268483992a23a9185e41b060cca71bfd7582788 (patch) | |
tree | 99392a33973f7e2618c9e6cc164fd3dca3db8638 | |
parent | 72e8d3f895946720c9151d4c2c7155cf4a592f48 (diff) |
crypto: atmel - Delete error messages for a failed memory allocation in six functions
Omit extra messages for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/crypto/atmel-aes.c | 6 | ||||
-rw-r--r-- | drivers/crypto/atmel-sha.c | 9 | ||||
-rw-r--r-- | drivers/crypto/atmel-tdes.c | 9 |
3 files changed, 5 insertions, 19 deletions
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 691c6465b71e..6fb24fc94b1f 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c | |||
@@ -2602,16 +2602,13 @@ static struct crypto_platform_data *atmel_aes_of_init(struct platform_device *pd | |||
2602 | } | 2602 | } |
2603 | 2603 | ||
2604 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); | 2604 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); |
2605 | if (!pdata) { | 2605 | if (!pdata) |
2606 | dev_err(&pdev->dev, "could not allocate memory for pdata\n"); | ||
2607 | return ERR_PTR(-ENOMEM); | 2606 | return ERR_PTR(-ENOMEM); |
2608 | } | ||
2609 | 2607 | ||
2610 | pdata->dma_slave = devm_kzalloc(&pdev->dev, | 2608 | pdata->dma_slave = devm_kzalloc(&pdev->dev, |
2611 | sizeof(*(pdata->dma_slave)), | 2609 | sizeof(*(pdata->dma_slave)), |
2612 | GFP_KERNEL); | 2610 | GFP_KERNEL); |
2613 | if (!pdata->dma_slave) { | 2611 | if (!pdata->dma_slave) { |
2614 | dev_err(&pdev->dev, "could not allocate memory for dma_slave\n"); | ||
2615 | devm_kfree(&pdev->dev, pdata); | 2612 | devm_kfree(&pdev->dev, pdata); |
2616 | return ERR_PTR(-ENOMEM); | 2613 | return ERR_PTR(-ENOMEM); |
2617 | } | 2614 | } |
@@ -2649,7 +2646,6 @@ static int atmel_aes_probe(struct platform_device *pdev) | |||
2649 | 2646 | ||
2650 | aes_dd = devm_kzalloc(&pdev->dev, sizeof(*aes_dd), GFP_KERNEL); | 2647 | aes_dd = devm_kzalloc(&pdev->dev, sizeof(*aes_dd), GFP_KERNEL); |
2651 | if (aes_dd == NULL) { | 2648 | if (aes_dd == NULL) { |
2652 | dev_err(dev, "unable to alloc data struct.\n"); | ||
2653 | err = -ENOMEM; | 2649 | err = -ENOMEM; |
2654 | goto aes_dd_err; | 2650 | goto aes_dd_err; |
2655 | } | 2651 | } |
diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index 8874aa5ca0f7..4d43081120db 100644 --- a/drivers/crypto/atmel-sha.c +++ b/drivers/crypto/atmel-sha.c | |||
@@ -2726,18 +2726,14 @@ static struct crypto_platform_data *atmel_sha_of_init(struct platform_device *pd | |||
2726 | } | 2726 | } |
2727 | 2727 | ||
2728 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); | 2728 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); |
2729 | if (!pdata) { | 2729 | if (!pdata) |
2730 | dev_err(&pdev->dev, "could not allocate memory for pdata\n"); | ||
2731 | return ERR_PTR(-ENOMEM); | 2730 | return ERR_PTR(-ENOMEM); |
2732 | } | ||
2733 | 2731 | ||
2734 | pdata->dma_slave = devm_kzalloc(&pdev->dev, | 2732 | pdata->dma_slave = devm_kzalloc(&pdev->dev, |
2735 | sizeof(*(pdata->dma_slave)), | 2733 | sizeof(*(pdata->dma_slave)), |
2736 | GFP_KERNEL); | 2734 | GFP_KERNEL); |
2737 | if (!pdata->dma_slave) { | 2735 | if (!pdata->dma_slave) |
2738 | dev_err(&pdev->dev, "could not allocate memory for dma_slave\n"); | ||
2739 | return ERR_PTR(-ENOMEM); | 2736 | return ERR_PTR(-ENOMEM); |
2740 | } | ||
2741 | 2737 | ||
2742 | return pdata; | 2738 | return pdata; |
2743 | } | 2739 | } |
@@ -2758,7 +2754,6 @@ static int atmel_sha_probe(struct platform_device *pdev) | |||
2758 | 2754 | ||
2759 | sha_dd = devm_kzalloc(&pdev->dev, sizeof(*sha_dd), GFP_KERNEL); | 2755 | sha_dd = devm_kzalloc(&pdev->dev, sizeof(*sha_dd), GFP_KERNEL); |
2760 | if (sha_dd == NULL) { | 2756 | if (sha_dd == NULL) { |
2761 | dev_err(dev, "unable to alloc data struct.\n"); | ||
2762 | err = -ENOMEM; | 2757 | err = -ENOMEM; |
2763 | goto sha_dd_err; | 2758 | goto sha_dd_err; |
2764 | } | 2759 | } |
diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index 592124f8382b..97b0423efa7f 100644 --- a/drivers/crypto/atmel-tdes.c +++ b/drivers/crypto/atmel-tdes.c | |||
@@ -1312,18 +1312,14 @@ static struct crypto_platform_data *atmel_tdes_of_init(struct platform_device *p | |||
1312 | } | 1312 | } |
1313 | 1313 | ||
1314 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); | 1314 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); |
1315 | if (!pdata) { | 1315 | if (!pdata) |
1316 | dev_err(&pdev->dev, "could not allocate memory for pdata\n"); | ||
1317 | return ERR_PTR(-ENOMEM); | 1316 | return ERR_PTR(-ENOMEM); |
1318 | } | ||
1319 | 1317 | ||
1320 | pdata->dma_slave = devm_kzalloc(&pdev->dev, | 1318 | pdata->dma_slave = devm_kzalloc(&pdev->dev, |
1321 | sizeof(*(pdata->dma_slave)), | 1319 | sizeof(*(pdata->dma_slave)), |
1322 | GFP_KERNEL); | 1320 | GFP_KERNEL); |
1323 | if (!pdata->dma_slave) { | 1321 | if (!pdata->dma_slave) |
1324 | dev_err(&pdev->dev, "could not allocate memory for dma_slave\n"); | ||
1325 | return ERR_PTR(-ENOMEM); | 1322 | return ERR_PTR(-ENOMEM); |
1326 | } | ||
1327 | 1323 | ||
1328 | return pdata; | 1324 | return pdata; |
1329 | } | 1325 | } |
@@ -1344,7 +1340,6 @@ static int atmel_tdes_probe(struct platform_device *pdev) | |||
1344 | 1340 | ||
1345 | tdes_dd = devm_kmalloc(&pdev->dev, sizeof(*tdes_dd), GFP_KERNEL); | 1341 | tdes_dd = devm_kmalloc(&pdev->dev, sizeof(*tdes_dd), GFP_KERNEL); |
1346 | if (tdes_dd == NULL) { | 1342 | if (tdes_dd == NULL) { |
1347 | dev_err(dev, "unable to alloc data struct.\n"); | ||
1348 | err = -ENOMEM; | 1343 | err = -ENOMEM; |
1349 | goto tdes_dd_err; | 1344 | goto tdes_dd_err; |
1350 | } | 1345 | } |