]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/msm/dsi: Add missing check for alloc_ordered_workqueue
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Tue, 10 Jan 2023 02:16:51 +0000 (10:16 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:43:57 +0000 (16:43 +0100)
[ Upstream commit 115906ca7b535afb1fe7b5406c566ccd3873f82b ]

Add check for the return value of alloc_ordered_workqueue as it may return
NULL pointer and cause NULL pointer dereference.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/517646/
Link: https://lore.kernel.org/r/20230110021651.12770-1-jiasheng@iscas.ac.cn
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/msm/dsi/dsi_host.c

index 743142e15b4c103f97bc3c1ecc82d611b8083bec..c59764f156f94d018bc5ac39ec1ee0b468762210 100644 (file)
@@ -1877,6 +1877,9 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi)
 
        /* setup workqueue */
        msm_host->workqueue = alloc_ordered_workqueue("dsi_drm_work", 0);
+       if (!msm_host->workqueue)
+               return -ENOMEM;
+
        INIT_WORK(&msm_host->err_work, dsi_err_worker);
        INIT_WORK(&msm_host->hpd_work, dsi_hpd_worker);