Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3562825pxb; Mon, 24 Jan 2022 12:17:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyishH0FqgZxRyzGxLbxKZgTo5CDXV2H+JU78QlqzjkiRxQSAHwQgct0TDYrx2ukPbr+YXv X-Received: by 2002:a17:90b:4b47:: with SMTP id mi7mr12774pjb.85.1643055434235; Mon, 24 Jan 2022 12:17:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643055434; cv=none; d=google.com; s=arc-20160816; b=glzqVMXHvG4/DytS2kXmoeuF8r2VD1tLX8iRdq/ScP+6o0nhT1PG5/x85C+Rz8fMX+ sp9bOzpXCeV1qaFHWFAUfQFdKBQK9EL0QGvASbsZ6vvo7UaVbjRse7x5XLc7Kbnihe9B VheQVgesnyd3ufLEOTLj45Qiwv77/D4rYJLekezwyfm3tNqN1yUuopO/KmXjf6ZCrpSw SjTnkP4C3cgqlyMIM5NT/Do7LHKQgiWdJA9H9DX0PKAY6POLS0BcG27UkAdx9J/s+N7W 3zvWXyyJoowo86vTyHpxuxzi+N6nWxyMCD5mgDAGwdEwRq5DxW0AyjgY+djfNX/dV7rm z4jw== 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=71abSL9YKRaWFT9gXMdwG7By6OiHjLcUwl3WsfPtYGw=; b=zu+iDkDnSAR4EV4cGEJ56w0/HiSw0jAqf17ixIN1+nUw2ZqBwHzjujCPeua7sQQ6KP DTqZEDhsHSfOJw2wi/E5TbQuHkxVRcxsv6V7F44iSZ8+L/9UJHTMy/dRymC6FjateqyE ILKVFfjMJ3LS+pmK9ftZds8WuAHdDeo1rTAlYay22roi1gqqRNt/8AZncIv2Y61OAZRW ybznFiZ0WWpYImvMTtxbuslriTg0XZiRsENe67NV4EulYgSLDVLsn03K6UUW9h3kkWIc Ag0glaABnNqChw51FqbJliZB1zUpt0SqPjzbMPyPJAr6ClpttGjcEiNFTQ77n8p9KPVT 1LJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CIfewN+D; 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 a18si275122pjh.81.2022.01.24.12.17.02; Mon, 24 Jan 2022 12:17:14 -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=CIfewN+D; 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 S242900AbiAXTSY (ORCPT + 99 others); Mon, 24 Jan 2022 14:18:24 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:36414 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346923AbiAXTJJ (ORCPT ); Mon, 24 Jan 2022 14:09:09 -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 DA981B8121A; Mon, 24 Jan 2022 19:09:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DF48C340E5; Mon, 24 Jan 2022 19:09:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051346; bh=qNILM1RdhmA5Zm0cLlQ79sNMcY7CTw2k9YHU8nTci04=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CIfewN+Dia7lY9GxI92G/GpSkMn81A0T7Et5NLLOtZ4IX1rFUUU0bDsB//VpDZnfq qcftELjV1qPwp1MOYrFiVbi5Jmnsl6oDHNs4lfAZT+X9e+1JQ9RuprhkSb6ISUO0ny CHTlI04a6kIhaWL9k5hW17dIIzoF8lKCO+ZSF2fo= 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 4.14 132/186] powerpc/6xx: add missing of_node_put Date: Mon, 24 Jan 2022 19:43:27 +0100 Message-Id: <20220124183941.357910302@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@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 bf4a125faec66..db2ea6b6889de 100644 --- a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c +++ b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c @@ -220,6 +220,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