Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3560493pxb; Mon, 24 Jan 2022 12:14:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzcGfyHFVHCdqNf8ePu8nzfRX2Z7NdVFvl+wXbY9zlIP881cquPCzJIaU8mrRmyilICswwr X-Received: by 2002:a62:3804:0:b0:4c7:373b:cb2 with SMTP id f4-20020a623804000000b004c7373b0cb2mr15312255pfa.50.1643055245227; Mon, 24 Jan 2022 12:14:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643055245; cv=none; d=google.com; s=arc-20160816; b=WuOUlQjGHk6YUtrkcXF9Q18Vq5efH/RmVp0U3SM4VzfSdxMQjoom0t6Dtr9cGHEeWK 2Ml3uiy2XHqSB3gLjZJfz9wcW/WS5PRbNc4AeF7+ELE8+QDV1y1J/YEwwN+pndZB97Sr wBfgsYoR8QGFBabFQTisF+H1hU3UI7nUFbMN5xWxa30ePwa4R/zoTe5fO39nZgWD1TAD r0fLBHpfTXwN9/Tx69WFTtxup7qArV3W+2SqnSs8VG4uDIswcQWnc+wRhKoltUQmzQ7h CR6TwRI4O8mNvetNgPZ61vtkVv5F5WJoBrmLz82JOX0LT25yLDB06/tNQasTN8NbD32K e28g== 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=CDN7OTowoq8A2I9hIRLxp3I3z47njpIZJpx7B90wVVg=; b=Rd8FWdzYFpekfEvKEr5hDjGMjcy9haMddGPXkmMf+3QgCA+EdAEJih4MyZE3Ef+G47 G5GRYNWcbYdOEYa8G4E/OXXu3TwznwZE02KfRP4NrBM18a4P+AaEeJfodjmt/By4Gp+1 ByIk8dAKun8jrgeJPV48kWfALxEDiPR4ltMqkMKG3K+l0dYjyJPnQ4szTRdkg8rmhaWQ ENagY6kavFN9uXSTkZaxebNd9GeWQ4lc+0IOLIK7ErrXXweMGALsh4kFDfGeYMsf204T fWZmC7MhetpReEBxkyQcszgR21H/kdSaWsednkjIJSoh0CXQC1YAoEznORqMGZ+LQhmV QN2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yZ04MY26; 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 d15si14423883pgk.641.2022.01.24.12.13.52; Mon, 24 Jan 2022 12:14: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=yZ04MY26; 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 S236829AbiAXTRL (ORCPT + 99 others); Mon, 24 Jan 2022 14:17:11 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:38822 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346929AbiAXTJL (ORCPT ); Mon, 24 Jan 2022 14:09:11 -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 dfw.source.kernel.org (Postfix) with ESMTPS id BDF8660B88; Mon, 24 Jan 2022 19:09:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BAD15C340E5; Mon, 24 Jan 2022 19:09:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051350; bh=GLtLK6jPA6nPtqriz3ZVOeIfZ5OpRTdv6BTEh612+3M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yZ04MY26ji0jSK5PoHw031ku+B2azKKJnYEytXp0Kckza9Vx+7zSSNW7mOU3yZXfE TfFzN16nWc9h/Rnoyx/DfmTZ0QyLP7vCWK1XqPczziklmxkLfEdWIASdNHH71ExGRK 2CfrjkiLUh+kRldc7a9IrZ2PmAAmtkWq4Lm204/Y= 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 133/186] powerpc/powernv: add missing of_node_put Date: Mon, 24 Jan 2022 19:43:28 +0100 Message-Id: <20220124183941.389960692@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 7d405a939ca960162eb30c1475759cb2fdf38f8c ] 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): // @@ 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-4-git-send-email-Julia.Lawall@lip6.fr Signed-off-by: Sasha Levin --- arch/powerpc/platforms/powernv/opal-lpc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/powernv/opal-lpc.c b/arch/powerpc/platforms/powernv/opal-lpc.c index 6c7ad1d8b32ed..21f0edcfb84ad 100644 --- a/arch/powerpc/platforms/powernv/opal-lpc.c +++ b/arch/powerpc/platforms/powernv/opal-lpc.c @@ -400,6 +400,7 @@ void __init opal_lpc_init(void) if (!of_get_property(np, "primary", NULL)) continue; opal_lpc_chip_id = of_get_ibm_chip_id(np); + of_node_put(np); break; } if (opal_lpc_chip_id < 0) -- 2.34.1