Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753311AbeAFMqP (ORCPT + 1 other); Sat, 6 Jan 2018 07:46:15 -0500 Received: from mout.web.de ([212.227.15.14]:56405 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753041AbeAFMqN (ORCPT ); Sat, 6 Jan 2018 07:46:13 -0500 Subject: [PATCH 1/3] mtd/nftlmount: Delete two error messages for a failed memory allocation in find_boot_record() From: SF Markus Elfring 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 References: <57d4cbcf-c99c-f3d5-e2bf-f67873f321ea@users.sourceforge.net> Message-ID: Date: Sat, 6 Jan 2018 13:45:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <57d4cbcf-c99c-f3d5-e2bf-f67873f321ea@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:2/aGZPbycKjXCVUgPoZRX0GLRAlQhU6kAK4aCsjxTzj6e6FC/Pg I/0iFyvadxYHxTHNdriAlE8dqEa+ATtUX9sPCXYsNoa4ctUe5BtStlBI3fcsUyU9usIlA0w hh0cJeIn6YvyMTTGGe6u9jQ9UFeuWuSArqeQG5MI/12GZmf/RN7HiaWg+zlJHdCoO/wB0DF buPiIWyJzibgNFzgAQXcQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:s8tawuZ8RKQ=:3177J1jaxdsWlE1PZ5vLyI s/0TgolzJXJkBy/BNYUjspny/DXfHMtM3aEPsJGuANhyr2dCWwxKimCKslGZ6CYkuDhkoFCwb TLqzAvVGwmJipQHgLjiJ6uAI/nxIL7IJ5PX8Y0UoMxFxH1T/vLaX4165HX53annYbOLatUABe aN3lhIk+pwFsZv9Wfq42Fup2wwAmIxBzrvKIX2WaKusWxd2/AKG5IauJ71ducBOALPT1VYh/A HpC5LEjU9eR8SYY8/0PTFILs01Kg8Y5OqD2I2GuTlJKx+3+YIW1eZJLyBBDJK1GZKBhL3zfVE ijiieohlq8rnYuztUckoM40esoLGq3R/kffxIWr0h+pifFPRakgJP6PfM1b1XQ2k/CXZQm9UB 4jN+1NJ18dQK/MjZCoxKIFusxvUyJjQFMNRzwAa1VvdWBj5cadE9YfFYLTaqudydiLJCNdivL nETZz2b1gXdlDH+Gn1xNPbYrC+++J99urjsWcYSZy710lZsJ6BcN2fGLs9ulUMlxeQtHExTdu baKN1oOfjOth6cOh4QXD8pwvIVFyTT5tpzeE95oA0VHl6Pn7cS8V4/XE1ckyiRk8A8BtvasWF NPQ1k5FyD3B+mzBTGMmxURVT9NxmOtfFhhHbwBDnpK88AvITO628yRlO77tlwcXwrOAbJ5HLU +Z2llFTIfFhQmldgFCAQ/LqccnqMWorNot9bNHDXu3LVhWJfgO7ucPkXDB1lSWtAIey5ArxJK iVIHcFKvk5CVOA0IFdsNVou2WeoR+k/PACikvxlkLaeOtnZH6ZTGB4EnV8EdneBGKbfdBmXxS W722QXu6LfICQTF90caSb1bi67hKybHWHYSDN4R2buCDEvx3V4= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring Date: Sat, 6 Jan 2018 11:04:59 +0100 Omit extra messages for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/mtd/nftlmount.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/mtd/nftlmount.c b/drivers/mtd/nftlmount.c index 184c8fbfe465..6b9634a70229 100644 --- a/drivers/mtd/nftlmount.c +++ b/drivers/mtd/nftlmount.c @@ -201,15 +201,12 @@ device is already correct. /* memory alloc */ nftl->EUNtable = kmalloc(nftl->nb_blocks * sizeof(u16), GFP_KERNEL); - if (!nftl->EUNtable) { - printk(KERN_NOTICE "NFTL: allocation of EUNtable failed\n"); + if (!nftl->EUNtable) return -ENOMEM; - } nftl->ReplUnitTable = kmalloc(nftl->nb_blocks * sizeof(u16), GFP_KERNEL); if (!nftl->ReplUnitTable) { kfree(nftl->EUNtable); - printk(KERN_NOTICE "NFTL: allocation of ReplUnitTable failed\n"); return -ENOMEM; } -- 2.15.1