Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757967AbeAIIMI (ORCPT + 1 other); Tue, 9 Jan 2018 03:12:08 -0500 Received: from smtp6-g21.free.fr ([212.27.42.6]:59470 "EHLO smtp6-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752936AbeAIIMH (ORCPT ); Tue, 9 Jan 2018 03:12:07 -0500 Subject: Re: [PATCH] misc/lis3lv02d: Delete an error message for a failed memory allocation in lis3lv02d_init_device() To: SF Markus Elfring , kernel-janitors@vger.kernel.org, Arnd Bergmann , Greg Kroah-Hartman Cc: LKML References: From: =?UTF-8?Q?=c3=89ric_Piel?= Message-ID: <6f1bcb25-b2bd-da30-5e9c-60340ceffed7@tremplin-utc.net> Date: Tue, 9 Jan 2018 09:11:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 08/01/18 22:33, SF Markus Elfring wrote: > From: Markus Elfring > 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 Thanks, looks fine. Signed-off-by: Éric Piel 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); >