Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3579512pxb; Mon, 24 Jan 2022 12:42:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdc5eWDuOMHjpqgQ+t1Ms6QGNrJUA2jWv2JRIi3RcYn4LjD5BZ2dOjvU6AQbptAJP530wR X-Received: by 2002:a63:f1a:: with SMTP id e26mr12956821pgl.590.1643056925314; Mon, 24 Jan 2022 12:42:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056925; cv=none; d=google.com; s=arc-20160816; b=mjS4P8IWKNcn2AOnRQMsW9sZ4AyidlQkcjEjh8Aih1iDFZOXS81q/BZbEsUL24s+ii vxDYAwvpOj0aD+Mx5Qg0IRLQrm7REnv5W0J7o7aHCbEkHA1+0giWRYjAlZFd1xfET9M4 7XZY7zbn5ttfdo4GRr0y1wMFAFbEugqeogkfM+8e/ralH9KeTS8fdCX9rn0+j7F2XJL+ oVc4RoKMRZcUTeJWpfYfyw8undZdfy0inyXxRwTrA8N/6mLcl0IsGYj8Z36+OyjwJZpe FtBM+lNqHo3uX9e6Ez7Rora3tdOLeAjSosUh08kMEN3p+F/IAML3FChsE8SRM4TjHaqb 0D1g== 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=E9ZuwqGv1Etm/WPQHrLDCbt9OALGSvkNBTmVF65LNCM=; b=QJJzXMoxrkCduT7ZF29nBDhhbkkEro9drGnwiGxu0ex2p54idx2Kt8h/lqAaz9Sg5e to423oxXmDPwC9cOTHp1ecezRqYMEXWYFuAHyllxaKZ/TJ6kK/5bO8Uq6CiMHYI2PETK a9UTc4hbRDYT+yTUuV/DTfOp9DYc1SQYDb2ion3akPGHXL4sPDveQNX+jSffTJIqJyoY kpBDBYuw+JW6wUWfc4cs0CkKn5nylwmFiBTCOjcQxw9cWjiWjEOdPcbZ6Q1IoNkySE2o 0c6JMGU5CP3T9kA2lO8cBEWj4iRtNifkrI22eBGZJm5dD2TftvEyNSjdTqt9doTTJjYr C0hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="DIRa/la6"; 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 u16si2839877plf.527.2022.01.24.12.41.48; Mon, 24 Jan 2022 12:42:05 -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="DIRa/la6"; 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 S1353043AbiAXT7H (ORCPT + 99 others); Mon, 24 Jan 2022 14:59:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350012AbiAXTnC (ORCPT ); Mon, 24 Jan 2022 14:43:02 -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 25316C03327C; Mon, 24 Jan 2022 11:22:01 -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 B8E6560B86; Mon, 24 Jan 2022 19:22:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9ECC0C340E5; Mon, 24 Jan 2022 19:21:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052120; bh=jbFpHmEm0LhR9WntBAIKJZUHg3ZypDEqqJtUJca1zAo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DIRa/la6ErLOijpnknOUstaC8TZM6lIpGO50kyafjtRSMtorRHiL/45JcPxHZh3Vz ME/IAiK4la4zTYqfOYOcVDC36LjcVeId5NBFb+Gtoyx7z2/VmjBzo9UTWepYRD+IGa wIdq3I5/pLBclHHtQu8BRdjFyKWIfajMCBOn3UUw= 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.19 178/239] powerpc/6xx: add missing of_node_put Date: Mon, 24 Jan 2022 19:43:36 +0100 Message-Id: <20220124183948.760342880@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183943.102762895@linuxfoundation.org> References: <20220124183943.102762895@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 8112b39879d67..7b4edf1cb2c8d 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