From patchwork Sun Jan 21 21:33:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10177133 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5F41D604D4 for ; Sun, 21 Jan 2018 21:33:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4092E26223 for ; Sun, 21 Jan 2018 21:33:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3390226E74; Sun, 21 Jan 2018 21:33:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C67E226223 for ; Sun, 21 Jan 2018 21:33:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750882AbeAUVdy (ORCPT ); Sun, 21 Jan 2018 16:33:54 -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-Language: en-GB 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-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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; }