mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Éric Piel" <eric.piel@tremplin-utc.net>
To: SF Markus Elfring <elfring@users.sourceforge.net>,
	kernel-janitors@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] misc/lis3lv02d: Delete an error message for a failed memory allocation in lis3lv02d_init_device()
Date: Tue, 9 Jan 2018 09:11:51 +0100	[thread overview]
Message-ID: <6f1bcb25-b2bd-da30-5e9c-60340ceffed7@tremplin-utc.net> (raw)
In-Reply-To: <c71380d4-50f4-3d8f-8c7f-4df5a0098402@users.sourceforge.net>

On 08/01/18 22:33, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 8 Jan 2018 22:26:06 +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>
Thanks, looks fine.

Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>

Maybe the "Kernel Janitors" can just pick it up?

Cheers,
Éric

> ---
>   drivers/misc/lis3lv02d/lis3lv02d.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c
> index e49888eab87d..ba2bd49c15fa 100644
> --- a/drivers/misc/lis3lv02d/lis3lv02d.c
> +++ b/drivers/misc/lis3lv02d/lis3lv02d.c
> @@ -1172,11 +1172,8 @@ int lis3lv02d_init_device(struct lis3lv02d *lis3)
>   
>   	lis3->reg_cache = kzalloc(max(sizeof(lis3_wai8_regs),
>   				     sizeof(lis3_wai12_regs)), GFP_KERNEL);
> -
> -	if (lis3->reg_cache == NULL) {
> -		printk(KERN_ERR DRIVER_NAME "out of memory\n");
> +	if (!lis3->reg_cache)
>   		return -ENOMEM;
> -	}
>   
>   	mutex_init(&lis3->mutex);
>   	atomic_set(&lis3->wake_thread, 0);
> 

  reply	other threads:[~2018-01-09  8:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-08 21:33 SF Markus Elfring
2018-01-09  8:11 ` Éric Piel [this message]
2018-01-09 10:55   ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6f1bcb25-b2bd-da30-5e9c-60340ceffed7@tremplin-utc.net \
    --to=eric.piel@tremplin-utc.net \
    --cc=arnd@arndb.de \
    --cc=elfring@users.sourceforge.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®