lkml.org 
[lkml]   [2023]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 5.10 07/19] drm/msm/dsi: Add missing check for alloc_ordered_workqueue
    Date
    From: Jiasheng Jiang <jiasheng@iscas.ac.cn>

    [ 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 | 3 +++
    1 file changed, 3 insertions(+)

    diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
    index 51e8318cc8ff4..5a76aa1389173 100644
    --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
    +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
    @@ -1913,6 +1913,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);

    --
    2.39.0
    \
     
     \ /
      Last update: 2023-03-27 00:36    [W:6.688 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site