Re: [PATCH v3 09/14] drm/msm/dpu: don't tear down a failed hw_init twice

From: Konrad Dybcio

Date: Mon Oct 26 2026 - 05:47:26 EST


On 10/24/26 1:19 AM, Dmitry Baryshkov wrote:
> When dpu_kms_hw_init() fails it calls _dpu_kms_hw_destroy() itself, and
> the caller then runs the ->destroy() callback, which calls
> _dpu_kms_hw_destroy() a second time. Since the global state object is
> finalised there, the second call deletes its list entry again and frees
> its state twice.
>
> Fold the hardware setup into dpu_kms_init(), undo the steps of
> dpu_kms_init() when it fails, and tell the caller not to run ->destroy()
> after a failed init.
>
> Fixes: 49e27d3c9cd6 ("drm/msm/dpu: finalise global state object")
> Assisted-by: LLM
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>
> ---

Acked-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>

Konrad