diff mbox

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

Message ID 8261d041-ccd9-c0f8-4530-a4afb43ee7ab@users.sourceforge.net (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

SF Markus Elfring Feb. 14, 2018, 4:17 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
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 <elfring@users.sourceforge.net>
---
 drivers/crypto/nx/nx-842-pseries.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Dan Streetman Feb. 14, 2018, 4:48 p.m. UTC | #1
On Wed, Feb 14, 2018 at 11:17 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> 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 <elfring@users.sourceforge.net>

Reviewed-by: Dan Streetman <ddstreet@ieee.org>

> ---
>  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
>
Herbert Xu Feb. 22, 2018, 3:12 p.m. UTC | #2
On Wed, Feb 14, 2018 at 05:17:08PM +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> 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 <elfring@users.sourceforge.net>

Patch applied.  Thanks.
diff mbox

Patch

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);