Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp441712iog; Mon, 13 Jun 2022 06:05:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTYzsXXDKp+XQhdgccKKwML50eQVUnvxG62eZDCUoyt6bMlbil5zKS8aY+o25kEYM7s5y9 X-Received: by 2002:a05:6a00:2999:b0:51b:e3c8:9e30 with SMTP id cj25-20020a056a00299900b0051be3c89e30mr52405788pfb.41.1655125424903; Mon, 13 Jun 2022 06:03:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125424; cv=none; d=google.com; s=arc-20160816; b=oMVbTAbIen9fHJvNPMRuzh1K4UqWwAM781gN6A8ag4t6I8I8VUVPLzjX91vLeUl9kb YyjM2bc34qhFsT26sY7I1XAV24gwZqViuKRK64DvP99NjCRvaszlM5yRZdnI45Cxw/7L cJrlnrfA6qjSXrQf+6EVr7SAiEyw1joJ5j3JU2XH9cGzBRzyGHegWgAH3dtBf2jhC04f puITg0yqAx3xSNzzPGmmOREKppZ/1eCUGMyBP267LTLTTrhOqQ6keoOavLg72q1+MNi2 zWlwBAU0rDWboAweEk/tE5qGsVIUirv9TYMihggi3QpEDN45jivImZzGhjx1aqb+rXG0 c6Mg== 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=4Dc0M+z1zqF2n5msX4qKN8Evfmk/1EUvKv++z2KALus=; b=WKatxiP3Q8NLykUAsuw7FbOz4cZbu5RZWBo1IbAZFne4o6MCQi6UHwC8cbBSmOSwX9 0JCmq6ZSl4084IRaJfrXDL94wMjRFhqmwFBBbUTDcBqkQ5WasmHlBI3iRnhKqc2FOtHL 4N5bRnkaHt0LvNh1jpwIc62eV+pB9gNtGkmzYzInUBMlVju18CXwcXJWj6n56KWBjVum 2fH0mcyOIngR3YxHVjlahtb3ZEQA5eCQf+vJRacBswzX8O1Dz7wnidwpkHK2fGCP1oWR b+MkzOhm3q3st3lHsXTWwOX1PK/GIeCOXhIRgmxbB4/4QTt4z4feVmlkvIbDG5BIfWPL m5IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nId1t7Qe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020a056a0016c600b0051e756bec2bsi10198308pfc.147.2022.06.13.06.03.29; Mon, 13 Jun 2022 06:03:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nId1t7Qe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1344700AbiFMKmm (ORCPT + 99 others); Mon, 13 Jun 2022 06:42:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345764AbiFMKkm (ORCPT ); Mon, 13 Jun 2022 06:40:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6536C20187; Mon, 13 Jun 2022 03:23:38 -0700 (PDT) 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 024ED60DC4; Mon, 13 Jun 2022 10:23:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 126F3C34114; Mon, 13 Jun 2022 10:23:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655115817; bh=zlr3C4xgJD135dQdTWBXK1U0qwJZQAP7U25NcO+I5cQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nId1t7QeADdvm+m5ZA8BTgFDT9JNHBzc8YeUU0vuPP3hOrNcXmGpIw65VfGLedl+v r6R24h4i5a4hfy0t3Vcv7WBKhAC+emU2ZdHadw2vyBHkoEut3e3H9DDb471K5qXGyS ByOyw4PCImx7lpR2svt3sK5hpSMwwpogc4oDiXSE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Wu , Wei Xu , Sasha Levin Subject: [PATCH 4.14 041/218] ARM: hisi: Add missing of_node_put after of_find_compatible_node Date: Mon, 13 Jun 2022 12:08:19 +0200 Message-Id: <20220613094918.093365439@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094908.257446132@linuxfoundation.org> References: <20220613094908.257446132@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Wu [ Upstream commit 9bc72e47d4630d58a840a66a869c56b29554cfe4 ] of_find_compatible_node will increment the refcount of the returned device_node. Calling of_node_put() to avoid the refcount leak Signed-off-by: Peng Wu Signed-off-by: Wei Xu Signed-off-by: Sasha Levin --- arch/arm/mach-hisi/platsmp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/mach-hisi/platsmp.c b/arch/arm/mach-hisi/platsmp.c index da5689ababf7..d7fbfb6d293d 100644 --- a/arch/arm/mach-hisi/platsmp.c +++ b/arch/arm/mach-hisi/platsmp.c @@ -70,14 +70,17 @@ static void __init hi3xxx_smp_prepare_cpus(unsigned int max_cpus) } ctrl_base = of_iomap(np, 0); if (!ctrl_base) { + of_node_put(np); pr_err("failed to map address\n"); return; } if (of_property_read_u32(np, "smp-offset", &offset) < 0) { + of_node_put(np); pr_err("failed to find smp-offset property\n"); return; } ctrl_base += offset; + of_node_put(np); } } @@ -163,6 +166,7 @@ static int hip01_boot_secondary(unsigned int cpu, struct task_struct *idle) if (WARN_ON(!node)) return -1; ctrl_base = of_iomap(node, 0); + of_node_put(node); /* set the secondary core boot from DDR */ remap_reg_value = readl_relaxed(ctrl_base + REG_SC_CTRL); -- 2.35.1