Re: [PATCH 00/10] drm/panel: Use refcounted allocation for remaining panel drivers

From: Maxime Ripard

Date: Thu May 07 2026 - 11:05:06 EST


Hi,

On Thu, May 07, 2026 at 01:52:58PM +0200, Albert Esteve wrote:
> This series converts 9 remaining panel drivers from the deprecated
> devm_kzalloc() + drm_panel_init() pattern to the refcounted
> devm_drm_panel_alloc() API. This follows the work by Anusha Srivatsa
> who introduced the refcounted panel allocation infrastructure [1] and
> converted a first batch of drivers [2] (the last part of a 5 sub-series).
>
> Reasoning:
> ----------
> The old allocation pattern is unsafe: when the panel device is
> unbound, devm frees the context struct immediately, but the DRM
> device may still hold a reference to the embedded drm_panel through
> the panel bridge, leading to a use-after-free. devm_drm_panel_alloc()
> wraps the allocation in a kref scheme, so the memory is only freed
> when the last reference is dropped.
>
> After this series, there are no remaining callers of drm_panel_init()
> under drivers/gpu/drm/panel/, and drm_panel_init() is entirely removed
> from the public API.
>
> [1] https://lore.kernel.org/all/20250331-b4-panel-refcounting-v4-0-dad50c60c6c9@xxxxxxxxxx/
> [2] https://lore.kernel.org/all/20250710-b4-driver-convert-last-part-july-v1-0-de73ba81b2f5@xxxxxxxxxx/
>
> Signed-off-by: Albert Esteve <aesteve@xxxxxxxxxx>

Aside from the minor comment on the doc in patch 10,
Reviewed-by: Maxime Ripard <mripard@xxxxxxxxxx>

Thanks!
Maxime

Attachment: signature.asc
Description: PGP signature