From: Kaustabh Chakraborty <kauschluss@disroot.org>
To: Miaoqian Lin <linmq006@gmail.com>
Cc: Inki Dae <inki.dae@samsung.com>,
Jagan Teki <jagan@amarulasolutions.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Andrzej Hajda <andrzej.hajda@intel.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Robert Foss <rfoss@kernel.org>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] drm/bridge: samsung-dsim: Fix device node reference leak in samsung_dsim_parse_dt
Date: Thu, 13 Nov 2025 18:09:22 +0000 [thread overview]
Message-ID: <209646801ba4a40da89aa16853524756@disroot.org> (raw)
In-Reply-To: <20251029074121.15260-1-linmq006@gmail.com>
On 2025-10-29 07:41, Miaoqian Lin wrote:
> The function samsung_dsim_parse_dt() calls of_graph_get_endpoint_by_regs()
> to get the endpoint device node, but fails to call of_node_put() to release
> the reference when the function returns. This results in a device node
> reference leak.
>
> Fix this by adding the missing of_node_put() call before returning from
> the function.
>
> Found via static analysis and code review.
>
> Fixes: 77169a11d4e9 ("drm/bridge: samsung-dsim: add driver support for exynos7870 DSIM bridge")
Is the Fixes: tag correct? This is what I get for relevant code:
74629c49e66cc (Marek Vasut 2023-05-14 08:46:25 -0300 2074) endpoint = of_graph_get_endpoint_by_regs(node, 1, -1);
74629c49e66cc (Marek Vasut 2023-05-14 08:46:25 -0300 2075) nr_lanes = of_property_count_u32_elems(endpoint, "data-lanes");
74629c49e66cc (Marek Vasut 2023-05-14 08:46:25 -0300 2076) if (nr_lanes > 0 && nr_lanes <= 4) {
74629c49e66cc (Marek Vasut 2023-05-14 08:46:25 -0300 2077) /* Polarity 0 is clock lane, 1..4 are data lanes. */
74629c49e66cc (Marek Vasut 2023-05-14 08:46:25 -0300 2078) of_property_read_u32_array(endpoint, "lane-polarities",
74629c49e66cc (Marek Vasut 2023-05-14 08:46:25 -0300 2079) lane_polarities, nr_lanes + 1);
74629c49e66cc (Marek Vasut 2023-05-14 08:46:25 -0300 2080) for (i = 1; i <= nr_lanes; i++) {
74629c49e66cc (Marek Vasut 2023-05-14 08:46:25 -0300 2081) if (lane_polarities[1] != lane_polarities[i])
74629c49e66cc (Marek Vasut 2023-05-14 08:46:25 -0300 2082) DRM_DEV_ERROR(dsi->dev, "Data lanes polarities do not match");
74629c49e66cc (Marek Vasut 2023-05-14 08:46:25 -0300 2083) }
74629c49e66cc (Marek Vasut 2023-05-14 08:46:25 -0300 2084) if (lane_polarities[0])
74629c49e66cc (Marek Vasut 2023-05-14 08:46:25 -0300 2085) dsi->swap_dn_dp_clk = true;
74629c49e66cc (Marek Vasut 2023-05-14 08:46:25 -0300 2086) if (lane_polarities[1])
74629c49e66cc (Marek Vasut 2023-05-14 08:46:25 -0300 2087) dsi->swap_dn_dp_data = true;
74629c49e66cc (Marek Vasut 2023-05-14 08:46:25 -0300 2088) }
This should be a fix for 74629c49e66c instead.
prev parent reply other threads:[~2025-11-13 18:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-29 7:41 Miaoqian Lin
2025-11-13 18:09 ` Kaustabh Chakraborty [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=209646801ba4a40da89aa16853524756@disroot.org \
--to=kauschluss@disroot.org \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=inki.dae@samsung.com \
--cc=jagan@amarulasolutions.com \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linmq006@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=simona@ffwll.ch \
--cc=stable@vger.kernel.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®