From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F11BCC433FF for ; Fri, 9 Aug 2019 00:38:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C38F5208C4 for ; Fri, 9 Aug 2019 00:38:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Xnk4PtiY"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=aj.id.au header.i=@aj.id.au header.b="Ffx6KwVw"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="N5RUPgeA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C38F5208C4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org 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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:To:From:Date:References: In-Reply-To:Message-Id:Mime-Version:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=tTj9UT111gcwBKRx1sxBO/RGAkF7GmYG9zzbqJJqXaU=; b=Xnk4PtiYpO9NxoygFhHoMQnkJb E7KjzFfOlb0zDp+PhzXiR7N1IfDJaQgcDwDL0U/Gw4/QU7ylaBS4RSOKsmby6uVQzG/bJXJMYJkLY GDCkA+UIPKvBNpAcZxXWZqwqted7NkPYmYMYWFhvQ3WS9X55++LrerjdAkaLqdWWd7ctlXC1d8k/r 7ozQc4fS3I1ka9Pz0tvvKSA7VQD4qNSjBJH/AP/mllpxShypvoMl3903z9XaTBy+sAcQESYJZp1mq rt8r5OOffI4StN1lOBYviNU+O7OZ9pw41uSpiJQRNxDA55R1bcLDUQVXqdhGYm/EJvXY1lFFVsD0w 99Q255jw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hvsvS-0002P6-OH; Fri, 09 Aug 2019 00:38:34 +0000 Received: from new4-smtp.messagingengine.com ([66.111.4.230]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hvsvM-0002Ih-0l; Fri, 09 Aug 2019 00:38:28 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id B5AF02687; Thu, 8 Aug 2019 20:38:21 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute4.internal (MEProxy); Thu, 08 Aug 2019 20:38:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm3; bh=qzgxGTZsCJlvV+dr0gENjfvelG+V+hv DaK0KMe9R8B0=; b=Ffx6KwVwOmajjT7vxnEXIp+p/A4+WuIBUt6KPvR9e0rnVEw 4jTCNBTUskMYYse+3gkG8HSlNZrOYm3boUcw8X3gS87V66Q4qMOlcDnTABC0OYoT o7eC9BbkU+ZVI1pdGlj826pZGcKN6kpIqr59yUgTRofmwLGW8hu07IxY3bzCus+a 0y3qxmNHBFJxmJCf6pMuRlEty0fbLawuSgKTxmCyH2qfZfdpljWMHDWx5JR5Huts 3hwSylwSCA88fB26CybC8wSClOP/Ijt3AOU+/FmlfaW9QoK4NWV4sAL4CXZ42zDE 0Z6dLJAZU1BJfGsLoBXA4rY5zwlvbkg+K8pu7bw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=qzgxGT ZsCJlvV+dr0gENjfvelG+V+hvDaK0KMe9R8B0=; b=N5RUPgeAxWz+56KbGktHZv 9freKvjIoKumB99CKFG0upclkvmCvSdG5Kz4kbZ2scT9qzDdzR5yb84FN/GB1n+6 UM2K2meYeno617yTwdXi6Bb3v9qRrG5SM86tolzM3d0jJpMQBBLhi6t1oAet/D0f X/VOz+vD9q8ASlc4vAGeIHEp/viMN2Xr+5FXQc1flObHrjK9IiATcOj77QglrYvs RMFOcqxoiIiM9CCqdFbhWvtiJI940ZJ1IQi6caNF+o5NdM9lO5q+vxCnnJtKrBjN Qxtd07hqnCM04oiSgevPQjodFnhe2AWhUz0Jo2ldfHwOBtdxmHWGXorQwasl5OXg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudduiedgfeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdetnhgu rhgvficulfgvfhhfvghrhidfuceorghnughrvgifsegrjhdrihgurdgruheqnecurfgrrh grmhepmhgrihhlfhhrohhmpegrnhgurhgvfiesrghjrdhiugdrrghunecuvehluhhsthgv rhfuihiivgeptd X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 64ECEE00A2; Thu, 8 Aug 2019 20:38:19 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.6-808-g930a1a1-fmstable-20190805v2 Mime-Version: 1.0 Message-Id: <7335d5d1-77c7-4cfe-9ba5-2fc81e3e69eb@www.fastmail.com> In-Reply-To: <20190808075104.15928-1-nishkadg.linux@gmail.com> References: <20190808075104.15928-1-nishkadg.linux@gmail.com> Date: Fri, 09 Aug 2019 10:08:45 +0930 From: "Andrew Jeffery" To: "Nishka Dasgupta" , marek.vasut@gmail.com, tudor.ambarus@microchip.com, dwmw2@infradead.org, computersforpeace@gmail.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, "Joel Stanley" , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org Subject: Re: [PATCH] mtd: spi-nor: aspeed-smc: Add of_node_put() X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190808_173828_251277_F745F7FD X-CRM114-Status: UNSURE ( 4.23 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On Thu, 8 Aug 2019, at 17:21, Nishka Dasgupta wrote: > Each iteration of for_each_available_child_of_node puts the previous > node, but in the case of a break from the middle of the loop, there is > no put, thus causing a memory leak. Upon termination of the loop > (whether by break or a natural exit), either ret will have a non-zero > value or child will be NULL. Hence add an of_node_put() that will > execute only when ret has a non-zero value, as calling of_node_put() on > a possible NULL value does not cause any further issues. > Issue found with Coccinelle. > > Signed-off-by: Nishka Dasgupta Reviewed-by: Andrew Jeffery ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/