From nobody Thu Apr 2 23:54:51 2026 Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.144.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0830E3C2F; Fri, 13 Feb 2026 18:02:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.19.144.205 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771005740; cv=none; b=DWq8M96t3F9aniOoEIRVh4Bg1bDY6hhXRrjtenu8rn7iZvvxOwnQb6WkPLlc0w0Kb43bl3IIbza4msY9sCbJQhNH8z41jxHfc9Ay01O9NuvtiEv6RtVFzrOVvP/rgKY9eFMejb2B5uFG/rJIrcNvRvLDcAzKLf/CI1s4CCCa/9s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771005740; c=relaxed/simple; bh=mXqi+ihoqe8CrKNDfS9EP0qg1F41n7FGyjapR79FGdI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=spv7yTPtIGwDhAtFpK5SHNE6Q/oPy+I4WGjENgDRqdu0tDIqHeA8Py20culOZglWpTv71oTwvGjpcqc3OPyb5NivQnVXaqKP1AIVA1M3xfPu4cq/DqnGNzllO5Dyf+DfA8piORSIzUuGEZfWdGOXcF/DdWz4RD52EBQGamBy8Ew= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=T96aE1OE; arc=none smtp.client-ip=192.19.144.205 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="T96aE1OE" Received: from mail-acc-it-01.broadcom.com (mail-acc-it-01.acc.broadcom.net [10.35.36.83]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id AE09DC0009C5; Fri, 13 Feb 2026 09:57:03 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com AE09DC0009C5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1771005423; bh=mXqi+ihoqe8CrKNDfS9EP0qg1F41n7FGyjapR79FGdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T96aE1OEksIGTDIZkOu+yI/C7Gy7OZHtM4Bwea/9fyK5Ek8oZEKDCglZ6sfDtdihy xG2JiTcLa+Cb8Wk2OiWlB1hUGZtbxlc9ltHl6HDJcr5EDRm8O6T249V33u17rOHsfP gUsEClHi8THt6rr9/o7RUnbZoOJQHzXBL50XXeWg= Received: from stbirv-lnx-1.igp.broadcom.net (stbirv-lnx-1.igp.broadcom.net [10.67.48.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail-acc-it-01.broadcom.com (Postfix) with ESMTPSA id 10B59AE94; Fri, 13 Feb 2026 12:57:02 -0500 (EST) From: Florian Fainelli To: stable@vger.kernel.org Cc: Pierre Gondois , Sudeep Holla , Greg Kroah-Hartman , Florian Fainelli , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org (open list) Subject: [PATCH stable 6.1 1/2] cacheinfo: Decrement refcount in cache_setup_of_node() Date: Fri, 13 Feb 2026 09:56:59 -0800 Message-Id: <20260213175700.1964980-2-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260213175700.1964980-1-florian.fainelli@broadcom.com> References: <20260213175700.1964980-1-florian.fainelli@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Pierre Gondois commit 3da72e18371c41a6f6f96b594854b178168c7757 upstream Refcounts to DT nodes are only incremented in the function and never decremented. Decrease the refcounts when necessary. Signed-off-by: Pierre Gondois Reviewed-by: Sudeep Holla Link: https://lore.kernel.org/r/20221026185954.991547-1-pierre.gondois@arm.= com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Florian Fainelli --- drivers/base/cacheinfo.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c index 9e11d42b0d64..54a66e4a3460 100644 --- a/drivers/base/cacheinfo.c +++ b/drivers/base/cacheinfo.c @@ -195,7 +195,7 @@ static void cache_of_set_props(struct cacheinfo *this_l= eaf, =20 static int cache_setup_of_node(unsigned int cpu) { - struct device_node *np; + struct device_node *np, *prev; struct cacheinfo *this_leaf; unsigned int index =3D 0; =20 @@ -205,19 +205,24 @@ static int cache_setup_of_node(unsigned int cpu) return -ENOENT; } =20 + prev =3D np; + while (index < cache_leaves(cpu)) { this_leaf =3D per_cpu_cacheinfo_idx(cpu, index); - if (this_leaf->level !=3D 1) + if (this_leaf->level !=3D 1) { np =3D of_find_next_cache_node(np); - else - np =3D of_node_get(np);/* cpu node itself */ - if (!np) - break; + of_node_put(prev); + prev =3D np; + if (!np) + break; + } cache_of_set_props(this_leaf, np); this_leaf->fw_token =3D np; index++; } =20 + of_node_put(np); + if (index !=3D cache_leaves(cpu)) /* not all OF nodes populated */ return -ENOENT; =20 --=20 2.34.1