Received: by 10.223.176.46 with SMTP id f43csp2190220wra; Sun, 21 Jan 2018 13:34:33 -0800 (PST) X-Google-Smtp-Source: AH8x224xVQ9iq6F2okyu20x3vO0jgzG/lw7MTBlhypGA0SZQ2Yo31YwyCpEIrFWNz1Gv2i5Gipn6 X-Received: by 10.99.122.15 with SMTP id v15mr5279284pgc.175.1516570473291; Sun, 21 Jan 2018 13:34:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516570473; cv=none; d=google.com; s=arc-20160816; b=IJRAYO2XFhGmz/Ap8TKY7xsArXKH0O4R8H2xFoEzexgaF8CEF1jJk8CNIf4gXjUVRi 1mn2tro+yCch3kv/X1PuuLcUIqGW9VDTtdVt4AHVYywPz6P59i8kiLGyYWo2Gl3UOjMo swuysDDnxqBNzjLJWNLQD5K4gW+zz1gJ2XTTOltGMatkl8tHsbuuoOt8f1xA5DQEjvwp E9NUwV88MzsgpnMgPltRTJzrFVGvV5XSsp5PTKKpxLz/Gn2b9kmJL4zxY78mJSLp21Dt 1FTCp0Ur1wYiAmAns3L0AMMZEBbHDAR5d8XlSyqoF/XET9dgK/8uO1iajZBllJdIEFdo yAIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:cc:to:arc-authentication-results; bh=ezDgAMRBnXu0dOZ94o7+oRcRhte9VFqBUXFMZ3aSnxk=; b=Advbwe16jfDNrMtok0oXCewImphG7N6kiwcZU2Gm/NmHCVCuDA3mNI6FOfBiy69jhU EAnVuhVhZmL5o9a2zyCbEJ1ECN8DzeyalsFXQejmRdt5AM41Ahjp7ssn3cnvvJjd2fvZ 2ccBcGef/X/gnf8BYDO4nj3CVwIsM5Ggs5Wa1OQDbOSbsxPDayMHNSC/fTYlq1fRWd7a VbFePEBC5bzqCOZ7fLAjgjXeq8wQ8RdTEjUEwrMDRykIYvL0V3E4S6TFcJdhgzp/z8gC 1Fz7+CjrPARtvz7Mm9cjsigb7ziRzRDQ4yLSo3ReQtVUGtg/+evs4faixLoW9+4uSbTs trMw== 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m10si12437177pgn.120.2018.01.21.13.34.17; Sun, 21 Jan 2018 13:34:33 -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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750942AbeAUVdz (ORCPT + 99 others); Sun, 21 Jan 2018 16:33:55 -0500 Received: from mout.web.de ([217.72.192.78]:50013 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750853AbeAUVdx (ORCPT ); Sun, 21 Jan 2018 16:33:53 -0500 Received: from [192.168.1.3] ([77.181.34.161]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LiUG8-1fDoWZ0mFg-00chVk; Sun, 21 Jan 2018 22:33:51 +0100 To: linux-input@vger.kernel.org, Dmitry Torokhov , Nick Dyer Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] Input: atmel_mxt_ts: Delete error messages for a failed memory allocation in two functions Message-ID: Date: Sun, 21 Jan 2018 22:33:50 +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:TmQTzFm0ucZsl8cy++WHz34KCctqel4b2ZE9e8zNIbQsDt7GVJX ZIvHmjaR4wfxi4gHtYA3HEJBNdiLm08ZJzNJW4Uy4BJ/riWmS8Vf2ot7biTfZdU6fiie46a 1mqhzmj+C/5qhkQbHFOlJxMVMr1So7vIqFXqGLOr0X5CpUsDhJqqLapLJ1XhSLjExDS3R6k LEp39ot6SXcz3SqiOT7gw== X-UI-Out-Filterresults: notjunk:1;V01:K0:rERRVwgaWI4=:N3f/EFvH7mDH0d92hCfeaP V/EVweFojeUA4oaPdC8vExe7ItWsbMURqo/Mhn+nZzAqX76XfWM62ZuGpxx4+yrUaxCpP1bBj j95AnHLL3N8MbupuXBHwMprD01e6zxER8i0e0uRETKeMsO5sSh/XimdeBYtt/8h20HK5RAnIO jl+K33OMVc4RSrKvcpyN0+6Vy1BJ39nVcXvdBRurkAxvhmXdzj2Vc3RSWLkVLBJj44rFdbxsE wjUglWSeVfA4IrEFffHe7YdvyiTj7M/cwyrvzrroLzpASOgTRPrXDk0CXh/EO+3z2X0MVXRsR C0L6az5WTxuHCs2BmhcPud3iPh8YRCzHg8MKF01r6sfE+ovCF/reVIs6FQww4o45CCEQNsf/F WW7eKYnoU9eJevqdgPEtVyH2wB8oUVMO6k8jkzkaw9pvGYylS2THJTZDeg9oKZSkyRM8ypIEz peZ7aSIQT+AFiA7R5y/tXZqVm5Yu0BczIfVldIsLSftoiwoEWPYF6Y+xFpy+KsK/dvHetg/dh UqiDX+/6v5n4FfaAP/9Nzafq18zqHfQcyqcfKeiKT6lR9sPltVaMimvM52SEt8Rq2tm4crmUW ydkaIBRykMFQu+VaHKQzOx3ZCnXFvFYt8TuptyZmOr+rvpk9Uwm8MR9M5DLd3a/PZ2iG64qfv OaDlCtALhHq8KaNJRCv+4UirXApySIKIsC+013avOm7SYu1ar6G14qOALIgnXcXt2lZAhPOgN HIf4LdiKA64PfW+gSLCZnVgulyqOyG7tRJExt4yJoafs03udGXoaafwtBFOIP1Cx89Bi+XAKg jIbeJ2D3h557ZwxM6uelDLIMCjngEAq/r6i7tDaz70QPzmeEeo= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Sun, 21 Jan 2018 22:25:31 +0100 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 --- 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