lkml.org 
[lkml]   [2018]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] misc/lis3lv02d: Delete an error message for a failed memory allocation in lis3lv02d_init_device()
From
Date
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);
>

\
 
 \ /
  Last update: 2018-01-14 23:18    [W:0.038 / U:1.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site