mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
drm/msm: clean event_thread->worker in case of an error
If worker creation fails, nullify the event_thread->worker, so that
msm_drm_uninit() doesn't try accessing invalid memory location. While we
are at it, remove duplicate assignment to the ret variable.
Fixes: 1041dee217
("drm/msm: use kthread_create_worker instead of kthread_run")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/490106/
Link: https://lore.kernel.org/r/20220617233328.1143665-2-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
This commit is contained in:
parent
7ad6586652
commit
c79bb6b92d
1 changed files with 1 additions and 1 deletions
|
@ -492,7 +492,7 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
|
|||
if (IS_ERR(priv->event_thread[i].worker)) {
|
||||
ret = PTR_ERR(priv->event_thread[i].worker);
|
||||
DRM_DEV_ERROR(dev, "failed to create crtc_event kthread\n");
|
||||
ret = PTR_ERR(priv->event_thread[i].worker);
|
||||
priv->event_thread[i].worker = NULL;
|
||||
goto err_msm_uninit;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue