From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (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 DCDD7165F16 for ; Sat, 21 Feb 2026 15:26:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.11.138.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771687622; cv=none; b=PMaxH+gNcMwh4xg4oSoDOjx2r4hCy72xg2cfHvBhXuOA8UEv5wxR5lDBB8idXie0Xsxk206CgbKnG2FUXxAUX+b7gsew7szE7eJsGdjguA3Af2eZETtLq/m5LVGOfsBghRCK8Ts05mUIzeuBvDLw8ZFqyyutWXjZduEFWPmsbpo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771687622; c=relaxed/simple; bh=CpBqYzKJdyWjUpSjPg7WvZWakCapieEoFK6pgPGGYMs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BomXl3QC566wNi9NPDPlX5LwTIm1wLpv9yAEtV8zz3v9R8gXs+ETcmRDSngB8hbncmN+/fiNkXeU9ZKSURjNUxRmuHSNWwNRbILsJ69kNSXZAKBU7SXGyN+EksMdQhklJjdlQ2lQIU3mBlScFf1fKGiY66MJMms0RDbcZe0ow80= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=sntech.de; spf=pass smtp.mailfrom=sntech.de; dkim=pass (2048-bit key) header.d=sntech.de header.i=@sntech.de header.b=wa1bCZvd; arc=none smtp.client-ip=185.11.138.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=sntech.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sntech.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sntech.de header.i=@sntech.de header.b="wa1bCZvd" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sntech.de; s=gloria202408; h=Content-Type:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Reply-To; bh=CpBqYzKJdyWjUpSjPg7WvZWakCapieEoFK6pgPGGYMs=; b=wa1bCZvd3zQ4i2ZKK4LlmvRFu7 FI7MZ8H1i3KUcrEtnbI6HU6uf/BHG7mbx5oj2ai/SXFm0FJ5Usekh+LOeRZjtZRHV0VNfrHuG0WIF sdb89KFHLfGpGoN/yFOOjFgt0i06jkR24Y6/oDV4zjHtfW6oNs2AKqkzWogmN2+OQwUvZQp8qVj3A Kd6pQZxxY2JAvZ3AU+FnJFfvMsVu+fO2hcGPYeGEsSlFQb4h3qxEZXsLiTbcfZUAj+z5K0NIbddCi wpXyCWLccXy5pdq91pjprK2iZ9+8GqoZhMakYgkBVpIU8Z2adRb/uqRvPcSScrRnzaFhFUszEBVrj jv3sjFCQ==; From: Heiko =?UTF-8?B?U3TDvGJuZXI=?= To: shawn.lin@rock-chips.com, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, xiaopeitux@foxmail.com Cc: Pei Xiao , Felix Gu Subject: Re: [PATCH] soc: rockchip: grf: fix device node refcount leak in error path Date: Sat, 21 Feb 2026 16:26:45 +0100 Message-ID: <20948198.jiFIW2sfyF@diego> In-Reply-To: <6295978.F8r316W7xa@diego> References: <6295978.F8r316W7xa@diego> 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" Am Samstag, 21. Februar 2026, 15:51:46 Mitteleurop=C3=A4ische Normalzeit sc= hrieb Heiko St=C3=BCbner: > Hi, >=20 > Am Samstag, 21. Februar 2026, 01:40:27 Mitteleurop=C3=A4ische Normalzeit = schrieb xiaopeitux@foxmail.com: > > From: Pei Xiao > >=20 > > The for_each_matching_node_and_match() macro automatically manages devi= ce > > node reference counts during normal iteration. However, when breaking o= ut > > of the loop early with return, the current iteration's node is not > > automatically released, leading to a reference count leak. > >=20 > > Fix this by adding of_node_put() before returning from the loop > > when fails. > >=20 > > Fixes: 75fb63ae0312 ("soc: rockchip: grf: Support multiple grf to be ha= ndled") > > Signed-off-by: Pei Xiao >=20 > Felix Gu was slightly faster [0], so I'll apply their patch once the merg= e- > window is closed. and I just realized that Shawn was actually even earlier [1] >=20 > Thanks > Heiko >=20 >=20 > [0] http://lore.kernel.org/r/20260217-grf-v1-1-2088c966875d@gmail.com [1] https://lore.kernel.org/all/1770814957-17762-1-git-send-email-shawn.lin= @rock-chips.com/