Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3548109pxb; Mon, 24 Jan 2022 11:58:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/frPC0wxcJ2JIuXoK+KzOuFPpscPuTfqh2eiKzU7V1du3V8LHVt7rNzBBnCzYqxd23mah X-Received: by 2002:a05:6a00:ac4:b0:4bd:6555:1746 with SMTP id c4-20020a056a000ac400b004bd65551746mr15499154pfl.39.1643054292935; Mon, 24 Jan 2022 11:58:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054292; cv=none; d=google.com; s=arc-20160816; b=yXM6rtEpKtwqUs2lCDNqEWUyJ7KehaBZf8yBYw5uoGIOPlZfWyjTssF8sNy7jDvnhf cbGv7wjUi+AU7RHe7rUX7EjjAa6wC87BAlIfAc7PvLVuWoFQ4VNt2sbO8zbxLKecxJfT 9DZ2acVPvEKULY+C08fRtNtX7SCF0Nb+Uje0xZavJhHOqj0PmmnSlU31TsO1EmigYV/o miZUg2QExJvJTogC8AzUM1PSv/9csKVrRmyrTKMf+8N+ie4/up6hwoSyhvQee/Ls3dii hAhWIT6B3BqYJWHKFW1P+1RRt7GRfvqjFqbjo5GuUadvTTf/r2ILuTN3uykXzVUEVGFd a++w== 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=Kya/xO/RpNKklGdABIg7PTrAKznuZi9pmtrPq+e3lcI=; b=GGQvJMWFnlPJgmxtJs1RYD0O4oTmt9a8C5d5Sl0REbqaL/Eioos0rZWI311hCf6ux3 7CwvMFwVWOTzud/Z97+h+ngas7+aPhKqI1stwFUBx+LAjIZgal/UcCKzdqZ/oGwjy6SZ 5kkqhkQpoYi/5Jci3LwQ40vAPueqenBNIM726dXs0ipE3lwyaqIE27pmp0AMwuJvlqco BJS1G3EBdNgnD2rBYfWG8QKWR4wn03A4P9orXNG3Uvm/hVmTovPv8a8EfC4/wCZofORM S+VvXTaxPFVzxoNXTGlYdlGC7lNjNiL5BU3MX1wiiGCblt2OdO+KMTUz92/3OiRwYosz zbUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IDDVLbzA; 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 u10si14276708plf.135.2022.01.24.11.58.00; Mon, 24 Jan 2022 11:58:12 -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=IDDVLbzA; 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 S1343776AbiAXSzf (ORCPT + 99 others); Mon, 24 Jan 2022 13:55:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344048AbiAXSxN (ORCPT ); Mon, 24 Jan 2022 13:53:13 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E151FC06175F; Mon, 24 Jan 2022 10:52:39 -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 ams.source.kernel.org (Postfix) with ESMTPS id A90C0B8121B; Mon, 24 Jan 2022 18:52:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B85D5C340E5; Mon, 24 Jan 2022 18:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050357; bh=nRljK2iWbb10p4w6RFd1lQ40Hofhpav2Nn+BCIRYQ08=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IDDVLbzAkBr63m3nN1+o6IOMmTMKowQKdRmbCVc/CzUtOTcp41BHMVNuacIJvnU2d wmY9zhSS0lBHRsuERQFUZBc6HsL299lq4a+bYRKu4HrhxVQOb5NjykbbTMIs3gHIil NKkebnAyOb1oVnmYaGwxb8HJabq/abgC742hOAGg= 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.4 085/114] powerpc/powernv: add missing of_node_put Date: Mon, 24 Jan 2022 19:43:00 +0100 Message-Id: <20220124183929.736400679@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183927.095545464@linuxfoundation.org> References: <20220124183927.095545464@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 e4169d68cb328..d28c4a9269c38 100644 --- a/arch/powerpc/platforms/powernv/opal-lpc.c +++ b/arch/powerpc/platforms/powernv/opal-lpc.c @@ -401,6 +401,7 @@ void 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