Re: [PATCH v3 03/14] drm/msm: unwind msm_drm_kms_init() on failure
From: Konrad Dybcio
Date: Mon Oct 26 2026 - 05:26:45 EST
On 10/24/26 1:19 AM, Dmitry Baryshkov wrote:
> msm_drm_kms_init() leaves behind whatever it has already set up when it
> fails and lets the caller sort it out: msm_drm_init() jumps to
> msm_drm_uninit(), which runs msm_drm_kms_uninit() for every device which
> has a kms. That is the teardown of a fully initialised KMS -- it flushes
> kms->wq, calls ->irq_uninstall() and frees the IRQ, none of which exist
> yet when the failure happened early.
>
> The kms driver's own init is the first step which can fail, and since
> commit a409b78fcdf7 ("drm/msm: move wq handling to KMS code") the
> workqueue is created by msm_kms_init() rather than by msm_drm_init(), so a
> failure there leaves a NULL kms->wq for flush_workqueue().
>
> Undo the steps which have completed instead, and let msm_drm_init() unwind
> its own error paths rather than calling the full teardown.
I *really* want us to get `impl Drop` soon...
Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>
Konrad