Patch "drm/mediatek: mtk_drm_crtc: Add checks for devm_kcalloc" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/mediatek: mtk_drm_crtc: Add checks for devm_kcalloc

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-mediatek-mtk_drm_crtc-add-checks-for-devm_kcallo.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 130a60798fdcb0d9fe9f44fe8d2e40c2313c23e2
Author: ruanjinjie <ruanjinjie@xxxxxxxxxx>
Date:   Mon Dec 5 17:51:15 2022 +0800

    drm/mediatek: mtk_drm_crtc: Add checks for devm_kcalloc
    
    [ Upstream commit 5bf1e3bd7da625ccf9a22c8cb7d65271e6e47f4c ]
    
    As the devm_kcalloc may return NULL, the return value needs to be checked
    to avoid NULL poineter dereference.
    
    Fixes: 31c5558dae05 ("drm/mediatek: Refactor plane init")
    Signed-off-by: ruanjinjie <ruanjinjie@xxxxxxxxxx>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
    Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20221205095115.2905090-1-ruanjinjie@xxxxxxxxxx/
    Signed-off-by: Chun-Kuang Hu <chunkuang.hu@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
index 112615817dcbe..5071f1263216b 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
@@ -945,6 +945,8 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev,
 
 	mtk_crtc->planes = devm_kcalloc(dev, num_comp_planes,
 					sizeof(struct drm_plane), GFP_KERNEL);
+	if (!mtk_crtc->planes)
+		return -ENOMEM;
 
 	for (i = 0; i < mtk_crtc->ddp_comp_nr; i++) {
 		ret = mtk_drm_crtc_init_comp_planes(drm_dev, mtk_crtc, i,



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux