[PATCH] crypto: nx-842: Delete an error message for a failed memory allocation in nx842_pseries_init()

Subsystems: crypto api, ibm power 842 compression accelerator, linux for powerpc (32-bit and 64-bit), the rest

STALE3110d

3 messages, 3 authors, 2018-02-22 · open the first message on its own page

[PATCH] crypto: nx-842: Delete an error message for a failed memory allocation in nx842_pseries_init()

From: SF Markus Elfring <hidden>
Date: 2018-02-14 16:17:50

From: Markus Elfring <redacted>
Date: Wed, 14 Feb 2018 17:05:13 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <redacted>
---
 drivers/crypto/nx/nx-842-pseries.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/nx/nx-842-pseries.c b/drivers/crypto/nx/nx-842-pseries.c
index bf52cd1d7fca..66869976cfa2 100644
--- a/drivers/crypto/nx/nx-842-pseries.c
+++ b/drivers/crypto/nx/nx-842-pseries.c
@@ -1105,10 +1105,9 @@ static int __init nx842_pseries_init(void)
 
 	RCU_INIT_POINTER(devdata, NULL);
 	new_devdata = kzalloc(sizeof(*new_devdata), GFP_KERNEL);
-	if (!new_devdata) {
-		pr_err("Could not allocate memory for device data\n");
+	if (!new_devdata)
 		return -ENOMEM;
-	}
+
 	RCU_INIT_POINTER(devdata, new_devdata);
 
 	ret = vio_register_driver(&nx842_vio_driver);
-- 
2.16.1

Re: [PATCH] crypto: nx-842: Delete an error message for a failed memory allocation in nx842_pseries_init()

From: Dan Streetman <hidden>
Date: 2018-02-14 16:49:24

On Wed, Feb 14, 2018 at 11:17 AM, SF Markus Elfring
[off-list ref] wrote:
From: Markus Elfring <redacted>
Date: Wed, 14 Feb 2018 17:05:13 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <redacted>
Reviewed-by: Dan Streetman <redacted>
quoted hunk
---
 drivers/crypto/nx/nx-842-pseries.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/nx/nx-842-pseries.c b/drivers/crypto/nx/nx-842-pseries.c
index bf52cd1d7fca..66869976cfa2 100644
--- a/drivers/crypto/nx/nx-842-pseries.c
+++ b/drivers/crypto/nx/nx-842-pseries.c
@@ -1105,10 +1105,9 @@ static int __init nx842_pseries_init(void)

        RCU_INIT_POINTER(devdata, NULL);
        new_devdata = kzalloc(sizeof(*new_devdata), GFP_KERNEL);
-       if (!new_devdata) {
-               pr_err("Could not allocate memory for device data\n");
+       if (!new_devdata)
                return -ENOMEM;
-       }
+
        RCU_INIT_POINTER(devdata, new_devdata);

        ret = vio_register_driver(&nx842_vio_driver);
--
2.16.1

Re: [PATCH] crypto: nx-842: Delete an error message for a failed memory allocation in nx842_pseries_init()

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2018-02-22 15:13:17

On Wed, Feb 14, 2018 at 05:17:08PM +0100, SF Markus Elfring wrote:
From: Markus Elfring <redacted>
Date: Wed, 14 Feb 2018 17:05:13 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <redacted>
Patch applied.  Thanks.
-- 
Email: Herbert Xu [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help