Commit e0ad1684 authored by Natalia Petrova's avatar Natalia Petrova Committed by sanglipeng
Browse files

drm/nouveau/dp: check for NULL nv_connector->native_mode

stable inclusion
from stable-v5.10.185
commit 5d43bb9b3e0c03751f69209ce277006499a9f747
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8L5XP

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5d43bb9b3e0c03751f69209ce277006499a9f747



--------------------------------

[ Upstream commit 20a2ce87 ]

Add checking for NULL before calling nouveau_connector_detect_depth() in
nouveau_connector_get_modes() function because nv_connector->native_mode
could be dereferenced there since connector pointer passed to
nouveau_connector_detect_depth() and the same value of
nv_connector->native_mode is used there.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: d4c2c99b ("drm/nouveau/dp: remove broken display depth function, use the improved one")

Signed-off-by: default avatarNatalia Petrova <n.petrova@fintech.ru>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230512111526.82408-1-n.petrova@fintech.ru


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 9c72374d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment