Skip to contentSkip to conversation

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

PATCH In review SF Markus Elfring 3 participants 3 messages Feb 14, 2018 – Feb 22, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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

From: Markus Elfring <[email protected]>
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.

---
 drivers/crypto/nx/nx-842-pseries.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/crypto/nx/nx-842-pseries.c +2 -3
index bf52cd1d7fca..66869976cfa2 100644
@@ -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);
Signature · 1 line
2.16.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
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.

Quoted 24 lines
---
 drivers/crypto/nx/nx-842-pseries.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/crypto/nx/nx-842-pseries.c +2 -4
index bf52cd1d7fca..66869976cfa2 100644
@@ -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

maintainer
#2 lore raw
In reply to SF Markus Elfring
Quoted 8 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
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.

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt