[Intel-gfx] [PATCH v5 2/7] drm/client: Do not acquire module reference
Javier Martinez Canillas
javierm at redhat.com
Wed Nov 1 12:01:12 UTC 2023
Thomas Zimmermann <tzimmermann at suse.de> writes:
> Do not acquire a reference on the module that provides a client's
> callback functions in drm_client_init(). The additional reference
> prevents the user from unloading the callback functions' module and
> thus creating dangling pointers.
>
> This is only necessary if there is no direct dependency between the
> caller of drm_client_init() and the provider of the callbacks in
> struct drm_client_funcs. If this case ever existed, it has been
> removed from the DRM code. Callers of drm_client_init() also provide
> the callback implementation. The lifetime of the clients is tied to
> the dependency chain's outer-most module, which is the hardware's
> DRM driver. Before client helpers could be unloaded, the driver module
> would have to be unloaded, which also unregisters all clients.
>
> Driver modules that set up DRM clients can now be unloaded.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
> ---
The change makes sense to me.
Acked-by: Javier Martinez Canillas <javierm at redhat.com>
--
Best regards,
Javier Martinez Canillas
Core Platforms
Red Hat
More information about the Intel-gfx
mailing list