From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 34483237180; Tue, 21 Jul 2026 20:30:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784665823; cv=none; b=Fa8OSFc85vJgpyLSI/ReukLWPLsLNvtTuV6CUt5LJ9TlusvNNWBOPddBlGgRV2RfFbrkijvUJj1ptzHq2+uw2Yb3gKHPgFgK1Fft0TldL/X4bgnr7PZJ/YOM0uuP3oiqomv5eeOzRjjDrKct6+a98/vuSSDLwISgRuowHAqxL0o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784665823; c=relaxed/simple; bh=K1GP3QWtPtjcZ0sauldEkDQ63dTnifaHXirf+fwRPzU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TQlH1uXg7D2oPI844k+e3ewnI9LE48DT2RjQHs5eiPmHL9C54HxJCV6v9hR5urSr2JpLYZgGI13fLT73n6DgtxPCpzHgpH5y9uLcFHNRf+zQ8d2lfRtlb/ZXo2orEhHwknac+EkJTN3f6hOAEB92zzI51CyarcaooJoIX656zBw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jgc0v6Ar; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="jgc0v6Ar" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94CDF1F000E9; Tue, 21 Jul 2026 20:30:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784665822; bh=GbO4BJPvdsYzVxIOR6YwNGQloNFkofa/LRRcs9x/xC8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jgc0v6ArsoO0pJNaxemgqBYxqFFoCuSkzII8k52O/HCAiItAxLS5nsadLV7d0MZZI YcTPOA1VvvUCicctJIeqmKVQzeByJTjVrAGvvN9+E8h5IoylZn3A5WOccYt4CBdiTr joHHIoJT4L+vd5xpU/EevhV/d5p/j0vi07WUMtm0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Felix Gu , Mikko Perttunen , Thierry Reding , Sasha Levin Subject: [PATCH 6.6 0448/1266] drm/tegra: dc: Fix device node reference leak in tegra_dc_has_output() Date: Tue, 21 Jul 2026 17:14:45 +0200 Message-ID: <20260721152451.861018215@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152441.786066624@linuxfoundation.org> References: <20260721152441.786066624@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Felix Gu [ Upstream commit 63a3998d792ab5c45304bf879e385a31fa923b61 ] The of_for_each_phandle() macro increments the reference count of the device node it iterates over. If the loop exits early, the reference must be released manually. In tegra_dc_has_output(), the function returns true immediately when a match is found, failing to release the current node's reference. Fix this by adding a call to of_node_put() before returning from the loop. Fixes: c57997bce423 ("drm/tegra: sor: Add Tegra186 support") Signed-off-by: Felix Gu Acked-by: Mikko Perttunen Signed-off-by: Thierry Reding Link: https://patch.msgid.link/20260128-dc-v1-1-a88205826301@gmail.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/tegra/dc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index caa1fe6cc386eb..9c46caa6192f41 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -100,8 +100,10 @@ bool tegra_dc_has_output(struct tegra_dc *dc, struct device *dev) int err; of_for_each_phandle(&it, err, np, "nvidia,outputs", NULL, 0) - if (it.node == dev->of_node) + if (it.node == dev->of_node) { + of_node_put(it.node); return true; + } return false; } -- 2.53.0