drm/msm: clean event_thread->worker in case of an error
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fri, 17 Jun 2022 23:33:25 +0000 (02:33 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:12 +0000 (09:33 +0100)
commitc83d0321d89cb89456bdc3536873342962c86e3a
tree453a475e1f08fcd863033fef1d13c13b61a46317
parent15e78c7f2ddd94a23e077207667087d2996e946f
drm/msm: clean event_thread->worker in case of an error

[ Upstream commit c79bb6b92defdcb834ceeeed9c1cf591beb1b71a ]

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: 1041dee2178f ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/msm/msm_drv.c