From: jsg Date: Thu, 30 Nov 2023 02:33:55 +0000 (+0000) Subject: drm/radeon: fix a possible null pointer dereference X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=63bcfe472f1345979e145b438677aeaa2f7dc1ce;p=openbsd drm/radeon: fix a possible null pointer dereference From Ma Ke 16fa59e273f8eb20ececeb570ab41c9d3d791429 in linux-6.1.y/6.1.64 2c1fe3c480f9e1deefd50d4b18be4a046011ee1f in mainline linux --- 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); }