From patchwork Thu Jan 4 19:29:49 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: 855785 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WgjoAPt/"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zCHvq60P8z9s7f for ; Fri, 5 Jan 2018 06:30:47 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=soO0sFvb6ZYowl0738xGyxKYuTPK1JWQjQvToEyhcJM=; b=WgjoAPt/L20/cZ 0ndsrAFzsUUopmG+cLfdD1cnFARvo20hl4/xpe58CGq69LQkC+spHcWHBmCR5iwy0mgM0/j0z6BRC JRgHIIB33gUacsRafG3dRY6PRGDfY8S2jbYStFc4/uUATRDopzD8i/4S0eO+EhXY3eb9CIgwcBYA0 s0laF2WhOfJlHKhm2XEk7cnXTRwPdfnhGZpP4kgkP0QPS9+6l+iQPqv/yC7tNnnZ/1jwKBZ6Qbe6c A0HVnvvhhkGgi2MeMf5JQ6BiDMsON0HNXLXnjD9Y6bMmdM79K/EFG7mUkS9K2BKpUwwXEbmH/9Bb9 L1htJscCLoMPfIDTzqwg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eXBDu-0005Pd-OM; Thu, 04 Jan 2018 19:30:42 +0000 Received: from mout.web.de ([212.227.17.11]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eXBDO-0003oZ-Up for linux-mtd@lists.infradead.org; Thu, 04 Jan 2018 19:30:38 +0000 Received: from [192.168.1.3] ([78.48.111.36]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Marpe-1eCuX70JKc-00KOa1; Thu, 04 Jan 2018 20:29:51 +0100 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 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-Language: en-GB 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= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180104_113011_875733_E3763094 X-CRM114-Status: GOOD ( 10.58 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [212.227.17.11 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [212.227.17.11 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, LKML Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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); /*