[Intel-xe] [PATCH] drm/xe: Fail xe_device_create() if wq allocation fails

Gustavo Sousa gustavo.sousa at intel.com
Thu May 18 22:02:48 UTC 2023


Quoting Gustavo Sousa (2023-05-18 17:45:04-03:00)
>Quoting Gustavo Sousa (2023-05-18 17:15:00-03:00)
>>Let's make sure we give the driver a valid workqueue.
>>
>>While at it, also make sure to call destroy_workqueue() only if the
>>workqueue is a valid one. That is necessary because xe_device_destroy()
>>is indirectly called as part of the cleanup process of a failed
>>xe_device_create().
>
>Hm... Just realized that xe_device_destroy() is not called in this case, because
>we goto err_put, which skips the call to drmm_add_action_or_reset().
>
>And I think I have found an issue with this: shouldn't
>drmm_add_action_or_reset() (or rather drmm_add_action() in this case) be the
>first thing we do after calling devm_drm_dev_alloc()? Otherwise, if anything
>fails in and we goto err_put, no cleanup is actually done.
>

Addressing this in [1]. This patch is incorporated in that new series.

[1] https://patchwork.freedesktop.org/series/117971/.

--
Gustavo Sousa


More information about the Intel-xe mailing list