Skip to content
Commit 89645241 authored by Michael Walle's avatar Michael Walle Committed by Greg Kroah-Hartman
Browse files

drm/mediatek: fix kernel oops if no crtc is found



[ Upstream commit 4662817a ]

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: 0d9eee91 ("drm/mediatek: Add drm ovl_adaptor sub driver for MT8195")
Signed-off-by: default avatarMichael Walle <mwalle@kernel.org>
Reviewed-by: default avatarNícolas F. R. A. Prado <nfraprado@collabora.com>
Tested-by: default avatarNícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: default avatarEugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: default avatarEugen Hristev <eugen.hristev@collabora.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20230905084922.3908121-1-mwalle@kernel.org/


Signed-off-by: default avatarChun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 98bd0b4a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment