mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/kmb: fix bridge reference leak on probe error and remove
@ 2026-10-09  3:35 Haotian Zhang
  2026-10-09  6:10 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 2+ messages in thread
From: Haotian Zhang @ 2026-10-09  3:35 UTC (permalink / raw)
  To: Anitha Chrisanthus, David Airlie, Simona Vetter, Linus Walleij,
	Luca Ceresoli, Louis Chauvet
  Cc: dri-devel, linux-kernel

kmb_dsi_host_bridge_init() looks up the ADV7535 bridge with
of_drm_find_and_get_bridge(), which takes a reference on the bridge, and
stores it in the global adv_bridge. That reference is never released, so
unbinding the driver leaves the bridge refcount permanently elevated and
prevents the bridge driver from ever being removed. The same happens
when probe fails after the bridge has been found.

Release the reference in kmb_dsi_host_unregister(), which is called both
from the probe error path and from kmb_remove().

Fixes: abbe7f8144d5 ("drm/kmb/dsi: convert to of_drm_find_and_get_bridge()")
Assisted-by: DeepSeek-V4.1-Flash
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
---
 drivers/gpu/drm/kmb/kmb_dsi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/kmb/kmb_dsi.c b/drivers/gpu/drm/kmb/kmb_dsi.c
index 59d0e856392f..483f4afe6317 100644
--- a/drivers/gpu/drm/kmb/kmb_dsi.c
+++ b/drivers/gpu/drm/kmb/kmb_dsi.c
@@ -184,6 +184,10 @@ void kmb_dsi_host_unregister(struct kmb_dsi *kmb_dsi)
 {
 	kmb_dsi_clk_disable(kmb_dsi);
 	mipi_dsi_host_unregister(kmb_dsi->host);
+
+	/* Release the bridge reference taken in kmb_dsi_host_bridge_init() */
+	drm_bridge_put(adv_bridge);
+	adv_bridge = NULL;
 }
 
 /*
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/kmb: fix bridge reference leak on probe error and remove
  2026-10-09  3:35 [PATCH] drm/kmb: fix bridge reference leak on probe error and remove Haotian Zhang
@ 2026-10-09  6:10 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2026-10-09  6:10 UTC (permalink / raw)
  To: Haotian Zhang
  Cc: Linus Walleij, David Airlie, Anitha Chrisanthus, Simona Vetter,
	Louis Chauvet, linux-kernel, dri-devel, Luca Ceresoli


On Fri, 09 Oct 2026 11:35:37 +0800, Haotian Zhang wrote:
> kmb_dsi_host_bridge_init() looks up the ADV7535 bridge with
> of_drm_find_and_get_bridge(), which takes a reference on the bridge, and
> stores it in the global adv_bridge. That reference is never released, so
> unbinding the driver leaves the bridge refcount permanently elevated and
> prevents the bridge driver from ever being removed. The same happens
> when probe fails after the bridge has been found.
> 
> Release the reference in kmb_dsi_host_unregister(), which is called both
> from the probe error path and from kmb_remove().
> 
> Fixes: abbe7f8144d5 ("drm/kmb/dsi: convert to of_drm_find_and_get_bridge()")
> Assisted-by: DeepSeek-V4.1-Flash
> Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
> ---
>  drivers/gpu/drm/kmb/kmb_dsi.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 



Multiple things here:
1. Your team ignored completely previous feedback.

2. You use multiple identities with this email, thus I actually doubt we speak
   with actual person.

3. Finally, same feedback:
You sent multiple independent patches, to multiple independent
subsystems. The amount of these patches clearly suggest this was
AI generated and most likely not tested.

More importantly, you sent all this work without properly organizing
relevant patches into patchsets. This makes reviewing difficult
and might cause multiple reviewers to address the same issue.
Replying to the entire set is impossible and requires handling each
patch independently, instead of applying or discarding the set.
Maintainers also won't see the bigger picture of your work. Quite
worrying.

This is on the verge of hostile patch: bomb us with so many
contributions, we won't be able to handle them in efficient manner,
like responding ONCE to ask you to slow down.  Considering all this
is untested and LLM generated, I have even more doubts whether this
should be considered for review.

Please read kernel documentation BEFORE posting more work. It will
explain you how to identify subsystems, how to organize your work per
subsystem (so a patchset grouping multiple patches with a short cover
letter), how to document usage of LLM and how what you should not do
if this was posted in a good faith.

Best regards,
Krzysztof





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-09  6:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-09  3:35 [PATCH] drm/kmb: fix bridge reference leak on probe error and remove Haotian Zhang
2026-10-09  6:10 ` Krzysztof Kozlowski

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®