Received: by 10.223.176.46 with SMTP id f43csp1223408wra; Wed, 24 Jan 2018 12:44:06 -0800 (PST) X-Google-Smtp-Source: AH8x227tSiK9ztRp4bS/qOn2tXWmS3R3X6hDJ9mdGTVV54XgtITRJzljmMmTY3NuASdF9rM1XT1S X-Received: by 2002:a17:902:b7cb:: with SMTP id v11-v6mr9194377plz.393.1516826646364; Wed, 24 Jan 2018 12:44:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516826646; cv=none; d=google.com; s=arc-20160816; b=M1yfkvE8MS4qIM3L6ubVBJ+9tGCSLF9V0UJIy4HJ8T0MSRwOOBR2ccWr1D56g/3v4g tVaDktGN23+r0XWAA9Zt7kP5UxR+jpy2y6I29BdT45U1t82Qjl81gdWLdiBUzHGRMVQT lxlgzEpEEAfEI6CRsZMkEYsF24+FqOiShrnxOKkSOK8HSmR5PhdT86dip1hIQCfEdfAV NgFOMt1g++YBbM7PuB/G9bg5erckqhUTNV+ZuP3k1OIXFmuMJZJr1pXRDZYiaX2qjGom zoxy2sWCkwbhYHI3t5EwJCBunLrlFbh+WFZYfxbVRBlUArzGc9CNPY5sgSnZLJ9/HcVf hPbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=enQYKAZD02k4/tbh1SB2IHhnpeVThcrhD/9ejn+HwKY=; b=Xes67yxYI/OYtLJFdZ4FHXBrauqHPN4uQJPSgPpRLE2TsltbWaIBaEhm5fH6nsIa+U lnyYo1xNob7k/+7YCGkeX3yxLHDMLhgyI4/WiPuqC8s2lmHHS6O9rbJ6kOMHgtkbAxhB yV6PFZEKwqXbs6BzJb9ctRteuw9BpNKCWAO7KDDKUHIU5jFQwzmi4FVcfqZ1CSTW6Hbk p7SSjIzuv2Ebk+wXdbAKntEzNhZVGby/G5XGoxtjD6q0/UP3P17cdqx1k5uB8KXwxcHS xiQJPuboB6YhsU6WL0cYAncKKJg7knocCZiMPRo9yY2F0J2tN2qWwWRIUfWlnombix8X HMDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc1-v6si714508plb.250.2018.01.24.12.43.43; Wed, 24 Jan 2018 12:44:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932371AbeAXUnI (ORCPT + 99 others); Wed, 24 Jan 2018 15:43:08 -0500 Received: from avasout06.plus.net ([212.159.14.18]:50125 "EHLO avasout06.plus.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932072AbeAXUnG (ORCPT ); Wed, 24 Jan 2018 15:43:06 -0500 X-Greylist: delayed 451 seconds by postgrey-1.27 at vger.kernel.org; Wed, 24 Jan 2018 15:43:06 EST Received: from lava ([80.229.148.18]) by smtp with ESMTP id eRlceUzaEdzR4eRldeMhn1; Wed, 24 Jan 2018 20:35:33 +0000 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.3 cv=CaYmGojl c=1 sm=1 tr=0 a=o7Djd4SkmPXITDn8qH+ssQ==:117 a=o7Djd4SkmPXITDn8qH+ssQ==:17 a=kj9zAlcOel0A:10 a=RgaUWeydRksA:10 a=FP58Ms26AAAA:8 a=beXlt2xKAAAA:8 a=GdwhSmZmNHaKCFtdu-8A:9 a=CjuIK1q_8ugA:10 a=gcY2M4Ci8LIz02MwfSIM:22 Received: from nick by lava with local (Exim 4.86_2) (envelope-from ) id 1eeRlc-0001ce-1c; Wed, 24 Jan 2018 20:35:32 +0000 Date: Wed, 24 Jan 2018 20:35:32 +0000 From: Nick Dyer To: SF Markus Elfring Cc: linux-input@vger.kernel.org, Dmitry Torokhov , LKML , kernel-janitors@vger.kernel.org Subject: Re: [PATCH] Input: atmel_mxt_ts: Delete error messages for a failed memory allocation in two functions Message-ID: <20180124203531.GA5922@lava.h.shmanahar.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-CMAE-Envelope: MS4wfEb0tWdlMFajbCEcIRSxgVDjmOmYl42yWRs9NP8xq+JxWjRSJk5smquVGpv9yxjgXAsIUTiFHLKH81fU8Gb3IYMUaD9czjoBgbaN7LmwmfhQmppZv0tB SBV8siOs8iGV2V/F4URKLV1Ob6uHXTF0Xv7SJ+rv6jDNJX6Lu7LAUwFJ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 21, 2018 at 10:33:50PM +0100, SF Markus Elfring wrote: > Omit extra messages for a memory allocation failure in these functions. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring Thanks! Signed-off-by: Nick Dyer > --- > drivers/input/touchscreen/atmel_mxt_ts.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c > index 7659bc48f1db..f38711e9c256 100644 > --- a/drivers/input/touchscreen/atmel_mxt_ts.c > +++ b/drivers/input/touchscreen/atmel_mxt_ts.c > @@ -1507,10 +1507,8 @@ static int mxt_update_cfg(struct mxt_data *data, const struct firmware *cfg) > MXT_INFO_CHECKSUM_SIZE; > config_mem_size = data->mem_size - cfg_start_ofs; > config_mem = kzalloc(config_mem_size, GFP_KERNEL); > - if (!config_mem) { > - dev_err(dev, "Failed to allocate memory\n"); > + if (!config_mem) > return -ENOMEM; > - } > > ret = mxt_prepare_cfg_mem(data, cfg, data_pos, cfg_start_ofs, > config_mem, config_mem_size); > @@ -1612,10 +1610,8 @@ static int mxt_get_object_table(struct mxt_data *data) > > table_size = data->info.object_num * sizeof(struct mxt_object); > object_table = kzalloc(table_size, GFP_KERNEL); > - if (!object_table) { > - dev_err(&data->client->dev, "Failed to allocate memory\n"); > + if (!object_table) > return -ENOMEM; > - } > > error = __mxt_read_reg(client, MXT_OBJECT_START, table_size, > object_table); > @@ -1714,7 +1710,6 @@ static int mxt_get_object_table(struct mxt_data *data) > data->msg_buf = kcalloc(data->max_reportid, > data->T5_msg_size, GFP_KERNEL); > if (!data->msg_buf) { > - dev_err(&client->dev, "Failed to allocate message buffer\n"); > error = -ENOMEM; > goto free_object_table; > } > -- > 2.16.0 >