Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752914AbeADTax (ORCPT + 1 other); Thu, 4 Jan 2018 14:30:53 -0500 Received: from mout.web.de ([212.227.17.11]:62812 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751829AbeADTaw (ORCPT ); Thu, 4 Jan 2018 14:30:52 -0500 Subject: [PATCH 1/2] mtdconcat: Delete an error message for a failed memory allocation in mtd_concat_create() 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: <07947bdd-2b30-e4b5-82f7-d98b62df858e@users.sourceforge.net> Message-ID: <53f3fdb5-c216-c4b1-cb9f-c5945ec56749@users.sourceforge.net> Date: Thu, 4 Jan 2018 20:29:49 +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: <07947bdd-2b30-e4b5-82f7-d98b62df858e@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:QzN+bqEMkD8yXq7xmRlZh3icw444wOAZu+rAjr6dMQiFJBypHFx Q7rN/GNCpDGEtfTvCwYcStP2404vvXDQOsVcb5ApebjO3H2DPn0nXkNpFdZjJTycpaTIR79 3ugrFU8/0yokTpbeU5hXKrU+fxrJNisJPUjoM2V+3l/w/PfrKQ0/+DjcVbsdWc78Iq8sr7z N/wSxBvgAH/mLaqxB7VJw== X-UI-Out-Filterresults: notjunk:1;V01:K0:joQJqrKiNRY=:APHGbPxTyLsAsdWyZ+FRu3 lxlE2LgtaQKVM70K4C2OILR1wH3U0gpTKYRaKnplv1TtQVC3AJ2V+fJjm9iCIyFEful3hj74Y 8feLZuSIIG4Vl3FeugMf5EB/98QBATdDWC+RHbLHdDRestz+fXPI+TimhmR52cMdWzRtggBtV 8zIyNQbfESNyDCWtx5FkcS/vRyk/WCjjnVyvOnbtr4PEZ7lZY1Bv2z9K0dpvG5hOdIfbJXHQu rmeQ6GAKmU4xbsiz+xZzhOekUEHBVs7TAFme4KNDzCwHQHb1Kl+wDlRRJozyLbYZIrnQDVeXP guyusXl1Q/qi61DSECGuTJvrlcl0VAhRvc1AxMD85XYbo/RmI5606r1j1FQb793sm/Iwy/YD8 bUwzle3Mpp3i3bY68470gDvQU5x4/mXZ+xw5NGHBDsAL9YLk8TYomD8BXyBfQX8+2/W9pD2pB 6MvaK308MBPmGTLb8Ri2o2i0vicP4n+LuN9rp7qA84EEQsM95uJGvZjUtHhaMh2z2SADITf4W moynYnPFGN11XllcnYwu1RaWeLWYCPBllqigesIMwvFksIjcA+h0jbKfLRa4Mxw2CntrOfdC3 EyZJR0oM83iXMZbw0uc9s6H8TboIR52Li3wRRGCa1ajhDgn2coh9nf2fssdAHXDUgWF2oBxHp sXo16N6eUiG5h+S2D9KCNNbUhRZ9qnVdYgH5REFmpRlB9HnEpu7uJzV+7G8wMc/zPvWdqKkGA 9a+LdsJFj0lpPY6GICn4zvHnEwbq3aAXRZL37IoSaXat9qU4a4WXHXtlOrSBqibB59L++eJwP 3l2PGMHLeunyX5YZnArRyPMNWwcN4/xDZPdd0KqUIM7L+TJYoA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring Date: Thu, 4 Jan 2018 19:55:10 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/mtd/mtdconcat.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c index 60bf53df5454..f1a60c55a126 100644 --- a/drivers/mtd/mtdconcat.c +++ b/drivers/mtd/mtdconcat.c @@ -668,12 +668,9 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c /* allocate the device structure */ size = SIZEOF_STRUCT_MTD_CONCAT(num_devs); concat = kzalloc(size, GFP_KERNEL); - if (!concat) { - printk - ("memory allocation error while creating concatenated device \"%s\"\n", - name); + if (!concat) return NULL; - } + concat->subdev = (struct mtd_info **) (concat + 1); /* -- 2.15.1