drm/mediatek: mtk_drm_crtc: Add checks for devm_kcalloc
authorruanjinjie <ruanjinjie@huawei.com>
Mon, 5 Dec 2022 09:51:15 +0000 (17:51 +0800)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Fri, 27 Jan 2023 14:51:11 +0000 (14:51 +0000)
commit5bf1e3bd7da625ccf9a22c8cb7d65271e6e47f4c
treedad22f718bf4e4113fe6a2a8f88ad1321272da01
parent4deef811828e87e26a978d5d6433b261d4713849
drm/mediatek: mtk_drm_crtc: Add checks for devm_kcalloc

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@huawei.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20221205095115.2905090-1-ruanjinjie@huawei.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_drm_crtc.c