]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
drm/nouveau/dp: check for NULL nv_connector->native_mode
authorNatalia Petrova <n.petrova@fintech.ru>
Fri, 12 May 2023 11:15:26 +0000 (14:15 +0300)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Mon, 2 Oct 2023 15:19:12 +0000 (17:19 +0200)
commita6de628c0b8a02c299bbc9133fbc529071e9c278
tree6a4438f5c990c3555eef56a85f88b6314f2be69b
parent89759f339f3ce87ba60d7236815e9088b9d0b487
drm/nouveau/dp: check for NULL nv_connector->native_mode

BugLink: https://bugs.launchpad.net/bugs/2033931
[ Upstream commit 20a2ce87fbaf81e4c3dcb631d738e423959eb320 ]

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: d4c2c99bdc83 ("drm/nouveau/dp: remove broken display depth function, use the improved one")
Signed-off-by: Natalia Petrova <n.petrova@fintech.ru>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230512111526.82408-1-n.petrova@fintech.ru
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/gpu/drm/nouveau/nouveau_connector.c