Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3580893pxb; Mon, 24 Jan 2022 12:44:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhzM+ISRlubL+2X8kMPGNr7JAyeOm7y7mXkQaf+waat1srS5VPUjCYI/BWli8b/LT954Np X-Received: by 2002:a62:3804:0:b0:4c7:373b:cb2 with SMTP id f4-20020a623804000000b004c7373b0cb2mr15399955pfa.50.1643057057016; Mon, 24 Jan 2022 12:44:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643057057; cv=none; d=google.com; s=arc-20160816; b=ttxKdjW1ZSEkUb3LWxho1NpXhUbN2LJCWuKaoXNzGZ+mE5MAtd9Ef3t/69iy34WN5t 8ERRldg14kYpXASDUHWoEmMdWSMOqdCJKA9KMzO0ul3McY/reJSIdXIosB+Cy9os/JeQ SNu32tvh0yZNULOz4KLnQDhluAk34PWp46o3VCmRQ44J0ISuAdrq2y8k+MJuLgJfWvpq O7CXkyr6+e16Pbf7QbPgyK/y02nlTLQlg4dtaJUJpy/jjVybE4UzRYKCVC3Qf+Yr7bwg S1t94hmaBxFU8YHKqSdKrUnlVtiUASBdP43VSA4CCzLGea3m5ekwk3G7j+We7r66AB05 LGgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/XWNJyWlBXtyo1KHm7pB+B5zRKUDDjPrnBf4Z1SL6i0=; b=XGidTSiZ3ktmHkCQTdhx5ZcE6LLLsccixviMN0NBTrHnt0D6Hb3/S23Rx2z55Ac677 2O9FNDLNMzywrZwabh4j+4ktpU+xzfykABYWwRoKzjNMSrExL/PUVvHjyTARaUtRfd0q mJMmJccKbLN1iMXUDYdxVHay5Hy4FjPyQZKbmm8C5ipcz1HijOebIn1YXnkXXFHpnKf3 AG7Y7egbeXJv1a/cJlDfwl+72/2XmZePu2PK56Gu6x0omot/+G17kybbh78gLkqAncaU dQyzcWvcEMcXekMIhQBInRBczaf/39+kFLvcIlmAp+1LGtitQEybCBLKVQUIqonXYt7K OSLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uDouDohx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n200si12611022pfd.264.2022.01.24.12.44.00; Mon, 24 Jan 2022 12:44:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uDouDohx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346574AbiAXUCX (ORCPT + 99 others); Mon, 24 Jan 2022 15:02:23 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:57844 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354020AbiAXTfq (ORCPT ); Mon, 24 Jan 2022 14:35:46 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A7C7BB81238; Mon, 24 Jan 2022 19:35:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE938C340E5; Mon, 24 Jan 2022 19:35:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052944; bh=ETddzE3Lq3EU9bMSDlE2ShnRd8iiKQWFS2i5TL7wyWA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uDouDohxeLZIRD//iDkQ7g+t1TKCYLIbl+fQNhqd6V17UL9MicLWcEbtHs8Ybfw1b gfoZCr+syRAtHz0z4c0gQQhWhmVZpId7hrP/fblgPacYGYPpy+L0Zp/pOkr7xhx6Ra 9gfWqR1c7eHYQfOjRERka3NSvhDo/6Yri90RUNII= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julia Lawall , Michael Ellerman , Sasha Levin Subject: [PATCH 5.4 224/320] powerpc/6xx: add missing of_node_put Date: Mon, 24 Jan 2022 19:43:28 +0100 Message-Id: <20220124184001.607075988@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Julia Lawall [ Upstream commit f6e82647ff71d427d4148964b71f239fba9d7937 ] for_each_compatible_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // @@ expression e; local idexpression n; @@ @@ local idexpression n; expression e; @@ for_each_compatible_node(n,...) { ... ( of_node_put(n); | e = n | + of_node_put(n); ? break; ) ... } ... when != n // Signed-off-by: Julia Lawall Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1448051604-25256-2-git-send-email-Julia.Lawall@lip6.fr Signed-off-by: Sasha Levin --- arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c index a1b7f79a8a152..de10c13de15c6 100644 --- a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c +++ b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c @@ -215,6 +215,7 @@ void hlwd_pic_probe(void) irq_set_chained_handler(cascade_virq, hlwd_pic_irq_cascade); hlwd_irq_host = host; + of_node_put(np); break; } } -- 2.34.1