Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3722962pxb; Mon, 24 Jan 2022 16:20:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJxU9X+0ywh2Xi0s8Kc45/XSMpNkqGoOWM8wZrhY97wrRwz4UsUVuy1IUG3UPk5taVTTSsf4 X-Received: by 2002:a17:90b:1806:: with SMTP id lw6mr807770pjb.82.1643069936713; Mon, 24 Jan 2022 16:18:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643069936; cv=none; d=google.com; s=arc-20160816; b=svWuJvIjEnf7cjwu3f7T/zgSVUFHc848nJTh7qkm3L6H0oLQrLb3PGHGTfmk55uejC s0X8XzS4pb32u7WcnxjruQFV0BeX9ePNcKZtUurSmD2fSjI8Yfeodw9eJW+mu6q6jIha xqV6J6aIErVaOBhD6wVZW0MoqBthzmcGn+u51y0ezvZnvOFwCpzdB58BIt2g3mlCYr46 LiGTj2Srh4MjNBD+Hi1X6RUrVdNV3wnEsPx3obK5+eVknpArxZDiv1z7Cd3pszwgAl/X CkNVbMzfZBLB/fGaCaLHw/z4e7qXv9wu2pDSZIaLyEnymk/aT084oTffZlE7xvmv3tRC 83qQ== 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=yk7ka996IAeWiSfCQxy1QmcBVoJaCHNuL0afp1uYBH8=; b=W6+BUD+3fAoJXpvTHYKCSrk4KxAn+Crkk3AVJ9bhj2kX0imw3TH6DMY9C4Sw9CSAxW I2kPKSrT6Dat2BwH+OasQVNJDdiSQFUHxauidji8EaTrY5t9arPNozmC26mdJvIk/az3 3yFjKXFO7J/OUOY++IyLR4a9+DNwAgsrkb5qOVl79MEPts2yTw4A02oaA+IOybt06ZHk 2MxQXGEL2N+IqJTE54HTMlRYT3ykR4LoPLjEyoeldpGPfHw8+jVQ3GVeJs/9HsV53oWP CNGSHSWGR+hz06wJ25A3JzC8f71jElySQsPZkkOElo9p/bq7zIxJtHB2rTEwsRCpFMyF BWsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RU03oQyT; 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 a186si8817060pge.747.2022.01.24.16.18.44; Mon, 24 Jan 2022 16:18:56 -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=RU03oQyT; 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 S2372783AbiAYAMb (ORCPT + 99 others); Mon, 24 Jan 2022 19:12:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1848976AbiAXXY3 (ORCPT ); Mon, 24 Jan 2022 18:24:29 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B769C07321A; Mon, 24 Jan 2022 13:29:47 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 04D1560C44; Mon, 24 Jan 2022 21:29:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D292DC340E4; Mon, 24 Jan 2022 21:29:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059786; bh=GjXLsfRDL+vMnvwCNX4tCqIZuHwbl8YDD1glN2o18Y8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RU03oQyTTRlTzj5y40M2iHAjLO3/7Vl8786t5dDdIRcr3+uYQsc+0qDpIqfySrpEe OfXNhuyPKffp9IqS+kdXMgdbxoqlhkiUDGMoVfU7JxQC+cRpV4KblkLFVYY+5+Ryu9 OqQ6Y3lgbAKGwHvamao3aPcSPJPdF0UbFyKaWM/o= 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.16 0734/1039] powerpc/6xx: add missing of_node_put Date: Mon, 24 Jan 2022 19:42:03 +0100 Message-Id: <20220124184149.999778545@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 15396333a90bd..a4b020e4b6af0 100644 --- a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c +++ b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c @@ -214,6 +214,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