Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751410AbeACUxA (ORCPT + 1 other); Wed, 3 Jan 2018 15:53:00 -0500 Received: from mout.web.de ([212.227.17.12]:54696 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750873AbeACUw6 (ORCPT ); Wed, 3 Jan 2018 15:52:58 -0500 To: linux-mtd@lists.infradead.org, Boris Brezillon , Brian Norris , Cyrille Pitchen , David Woodhouse , Marek Vasut , Richard Weinberger Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] mtd/inftlmount: Delete error messages for a failed memory allocation in two functions Message-ID: Date: Wed, 3 Jan 2018 21:52:07 +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:dJrZW7xpgbzgGBw/8fFkOiSq4HmPsKf8Hw49390iPFIZPAfUo/Q 4UmsP19zfn+K9MerDt2bqxBjbbacTAtfWrJN4rvEmqDZYS9uLFN74n1fdu44pVil2nts72C JX28TMSJjH26VYif3kHNAIUN2Pdx2rLE0zGLAowbn2xikOqlMchpOPFOvyiQSeT2UvxtAeo fxlkQ3tfNxI850k4XcC1A== X-UI-Out-Filterresults: notjunk:1;V01:K0:u3J7oTy85Zc=:mF4fn2SSm9s80oze5F+QhQ HfKTQYHUb599nR+3UCgdGNCH5SlU+Db3R5WCw+hVWWtT1BQRoyWsUI6+oORI76gtVStJzWvO7 tbUFizTEtL7wC0vZ9KUgOE4LP8uELrHE/+78asbxyjjr7KO9LfFRU4swVtaRd59oHAZyTTzBd 91tWbKmnaOgBtY9/Jcc7DYrJpZeF0vbGwLscrGH5AOPoffCdPMgaCAIREvLyjLk5sJb9qwUF/ hV27qKhPT7dw0W2YPIY9M3/DjgwXF7zsDzkDfz6H0ZE8PsTaMra1iRw8yhWqjXPY7lkQpEg4p bxTzWiZ/FHZgPwR1r0NIrGyKXi/4oAcXYMFtdXKZb0ueL2bbDXI6HnBfu3P7VOgTHoIhFBMY3 cCM0V/MXEjzJAQ7xXRUEAFB+70yvVAIu27mZqf3UWJwE7sFDlX5o03pCw13jxQWSC4be5Hs7v ooCSmmqOFS8GcddOBe4ir2o9vaC+xpoC5n8TcUVjzC4SmDtZD1A/SJ+M4U+UbRornjkAgYkBE AMRERRjMNDVblSAK7JJS671nhyuG30zOXWTybrnCWdSOzh4mJRgUaEJLUtXcenZwAstzXR1dF SQlNgjLY/3bksHWPx1q4mEqBYYb9PjX9692usOsbIaAz0fKpGgWwBeUrxsBJQxxEsvWez+XMz 8OXdqJpI7erB59D95W4JV4+jYzn4ccbN38DHfj+QiBNdX5pUgTUJm/rkv+3m828xDvJ0vXUgJ vNMfxkBzQ5PAGuDVvnkiR+gQLdLDwNsX3TWvtEEz1fZC/eANyt2zAHqGNkNrVBnZ00mESL7YS t8a2c5lp1uLSxlJKe/ljOcSFZB9WVcC4wFerwwfm7tnPLrmr84= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring Date: Wed, 3 Jan 2018 21:45:19 +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/mtd/inftlmount.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c index 8d6bb189ea8e..e5dd55021602 100644 --- a/drivers/mtd/inftlmount.c +++ b/drivers/mtd/inftlmount.c @@ -273,19 +273,12 @@ static int find_boot_record(struct INFTLrecord *inftl) /* Memory alloc */ inftl->PUtable = kmalloc(inftl->nb_blocks * sizeof(u16), GFP_KERNEL); - if (!inftl->PUtable) { - printk(KERN_WARNING "INFTL: allocation of PUtable " - "failed (%zd bytes)\n", - inftl->nb_blocks * sizeof(u16)); + if (!inftl->PUtable) return -ENOMEM; - } inftl->VUtable = kmalloc(inftl->nb_blocks * sizeof(u16), GFP_KERNEL); if (!inftl->VUtable) { kfree(inftl->PUtable); - printk(KERN_WARNING "INFTL: allocation of VUtable " - "failed (%zd bytes)\n", - inftl->nb_blocks * sizeof(u16)); return -ENOMEM; } @@ -562,12 +555,8 @@ int INFTL_mount(struct INFTLrecord *s) /* Temporary buffer to store ANAC numbers. */ ANACtable = kcalloc(s->nb_blocks, sizeof(u8), GFP_KERNEL); - if (!ANACtable) { - printk(KERN_WARNING "INFTL: allocation of ANACtable " - "failed (%zd bytes)\n", - s->nb_blocks * sizeof(u8)); + if (!ANACtable) return -ENOMEM; - } /* * First pass is to explore each physical unit, and construct the -- 2.15.1