From 63bcfe472f1345979e145b438677aeaa2f7dc1ce Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 30 Nov 2023 02:33:55 +0000 Subject: [PATCH] drm/radeon: fix a possible null pointer dereference From Ma Ke 16fa59e273f8eb20ececeb570ab41c9d3d791429 in linux-6.1.y/6.1.64 2c1fe3c480f9e1deefd50d4b18be4a046011ee1f in mainline linux --- sys/dev/pci/drm/radeon/radeon_connectors.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/pci/drm/radeon/radeon_connectors.c b/sys/dev/pci/drm/radeon/radeon_connectors.c index f7431d22460..5837af5123a 100644 --- a/sys/dev/pci/drm/radeon/radeon_connectors.c +++ b/sys/dev/pci/drm/radeon/radeon_connectors.c @@ -1122,6 +1122,8 @@ static int radeon_tv_get_modes(struct drm_connector *connector) else { /* only 800x600 is supported right now on pre-avivo chips */ tv_mode = drm_cvt_mode(dev, 800, 600, 60, false, false, false); + if (!tv_mode) + return 0; tv_mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; drm_mode_probed_add(connector, tv_mode); } -- 2.20.1