drm/msm: Add missing check and destroy for alloc_ordered_workqueue
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Mon, 9 Jan 2023 02:20:38 +0000 (10:20 +0800)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Wed, 18 Jan 2023 01:25:18 +0000 (03:25 +0200)
commit643b7d0869cc7f1f7a5ac7ca6bd25d88f54e31d0
tree4959a3eaa44f4e4a8f2779a7d2188e2d0a2ffe49
parentd839f0811a31322c087a859c2b181e2383daa7be
drm/msm: Add missing check and destroy for alloc_ordered_workqueue

Add check for the return value of alloc_ordered_workqueue as it may return
NULL pointer.
Moreover, use the destroy_workqueue in the later fails in order to avoid
memory leak.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/517419/
Link: https://lore.kernel.org/r/20230109022038.2163-1-jiasheng@iscas.ac.cn
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drivers/gpu/drm/msm/msm_drv.c