Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757622AbeAHVdQ (ORCPT + 1 other); Mon, 8 Jan 2018 16:33:16 -0500 Received: from mout.web.de ([212.227.15.4]:64341 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757496AbeAHVdN (ORCPT ); Mon, 8 Jan 2018 16:33:13 -0500 To: kernel-janitors@vger.kernel.org, Arnd Bergmann , Eric Piel , Greg Kroah-Hartman Cc: LKML From: SF Markus Elfring Subject: [PATCH] misc/lis3lv02d: Delete an error message for a failed memory allocation in lis3lv02d_init_device() Message-ID: Date: Mon, 8 Jan 2018 22:33:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:7v+qHOlHLG3uJ9zqlUbjjuFAG38ie1i/1PeGMCTcZPQZewYp650 s46TqyhgSWoQ2R4K+mrzcT+EvjOeseidWaSiBtECtFsb80MDkoemHMTvG1dwMiFj4caE2CV mvVo92MsAsijlrE1K3td2Ebzs8uL754SuvppSDYlqGaXTIKUFVd9UNo/NCaJ3oeZSpcZBFH 38WDvtPxKGCKriCU6CdOQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:cyxdnkwawUk=:nGsf+Q3JgDYw8LMkAn58vK CfoLegGVOAcY7ehhYxX5yHbe9O9FK4KgC45l29RChRiSJRtJw2LDZtLYDAjdYUjIg2N36xEgb sHgi3gr2OHiVQuenGF+7KU803fh3Acbmc/9MpGtjV4NRUYbEKzoH48AHdVNhoG0Z8wB+HWBaJ yoNd6omp5ztqAaaCay90SWJgWy5nuQTpj3iN60xdq/NKot8JQfN9pJ361Mi4EFHhNkjOk5IwP szYMl0UD5UgnpoF/LbrXRMCYDbtNIpdjdUEUjHdlH1fiGiTw05F5Qnw3Okw7QjCUGd9iZgthV 6+rd7zC+2P3rm879jKqh56tp4IR9fdRUxArWhdIcyiMe2EMC/JT66X0ogQ4WS+40O1HJm+rMW Nthf+fIAtcyS+khLdYT58t3gLCPSZKAAFT5SKS2PIKA20YKsEml+BMAJmr6503tMcjC9vGHlX XPSb4Y9BzVA4dOc0TyOANXhk656tNXRyIKw0IO3L23x024+17QeI5FpFfaP8dC3kRvyzb2AhM xnOHP5qfZrJ0fydhwBbNt9kFSZISyxGG+T+37Wh8LHU36nbRQY9wnpQQHoDIYim2jIDA31kQ1 c0qkRUN4LzlOC2z3heX18y9EtR6Yd3PkVke3P2fJGk04fBOCIire431cHkyR9I/71vI2bVn2P Mdprz8FI8nMAdBOyn4FOCEL9+QXdooQdddXECPrkmEcxx7i6uw0q7msakpWASFPxT6SIBy7L1 N1TDztnIIyWI/B8mtfL7r/bUVGRIuUAKsPeGIca6GVFPvM8rfzkbQW6EfxaXg01AzHxwLf2nB sFmRdfQSYiGj5yMK996HA92OhA5PF1Cry6QiyTer6ugPoDIv0A= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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 --- 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); -- 2.15.1