]> git.itanic.dy.fi Git - linux-stable/commit
drm/mediatek: fix kernel oops if no crtc is found
authorMichael Walle <mwalle@kernel.org>
Tue, 5 Sep 2023 08:49:21 +0000 (10:49 +0200)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Thu, 23 Nov 2023 15:04:52 +0000 (15:04 +0000)
commit4662817aed5a9d6c695658d0105d8ff4b84ac6cb
treebefddde564b302217e8614fb947dd25afb594eb0
parent9aa6a662c309e6f8770972840948af963bd6ff34
drm/mediatek: fix kernel oops if no crtc is found

drm_crtc_from_index(0) might return NULL if there are no CRTCs
registered at all which will lead to a kernel oops in
mtk_drm_crtc_dma_dev_get(). Add the missing return value check.

Fixes: 0d9eee9118b7 ("drm/mediatek: Add drm ovl_adaptor sub driver for MT8195")
Signed-off-by: Michael Walle <mwalle@kernel.org>
Reviewed-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com>
Tested-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Eugen Hristev <eugen.hristev@collabora.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20230905084922.3908121-1-mwalle@kernel.org/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_drm_drv.c