On Sun, Dec 28, 2025 at 07:21:33PM +0200, Dmitry Baryshkov wrote:
> Mixing devm and drmm functions can result in a use-after-free errors.
> Change dpu_writeback_init() to use drmm_

The commit message should explain what the problem is. "can result" is
very vague.

> Fixes: 0b37ac63fc9d ("drm/msm/dpu: use drmm_writeback_connector_init()")
> Reported-by: Christophe JAILLET <[email protected]>
> Closes: 
> https://lore.kernel.org/r/[email protected]
> Signed-off-by: Dmitry Baryshkov <[email protected]>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c 
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c
> index 7545c0293efb..6f2370c9dd98 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c
> @@ -5,6 +5,7 @@
>  
>  #include <drm/drm_edid.h>
>  #include <drm/drm_framebuffer.h>
> +#include <drm/drm_managed.h>
>  
>  #include "dpu_writeback.h"
>  
> @@ -125,7 +126,7 @@ int dpu_writeback_init(struct drm_device *dev, struct 
> drm_encoder *enc,
>       struct dpu_wb_connector *dpu_wb_conn;
>       int rc = 0;
>  
> -     dpu_wb_conn = devm_kzalloc(dev->dev, sizeof(*dpu_wb_conn), GFP_KERNEL);
> +     dpu_wb_conn = drmm_kzalloc(dev, sizeof(*dpu_wb_conn), GFP_KERNEL);
>       if (!dpu_wb_conn)
>               return -ENOMEM;
>  

-- 
Regards,

Laurent Pinchart

Reply via email to