From ccda25021133bc8723573645d79cfb8251bf0ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Fri, 24 Nov 2023 17:39:28 +0100 Subject: [PATCH] drm: Test `funcs` is not NULL in drm_fb_helper_debug_enter() [Why] At least in i915, it is NULL in my tests because the code behind it was removed a long time ago. We didn't execute this function before the introduction of vt_drmfb, so it didn't cause any problems. --- drivers/gpu/drm/drm_fb_helper.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 0092a8f70d3..b4f5edbca65 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -169,7 +169,11 @@ int drm_fb_helper_debug_enter(struct fb_info *info) continue; funcs = mode_set->crtc->helper_private; +#ifdef __linux__ if (funcs->mode_set_base_atomic == NULL) +#elif defined(__FreeBSD__) + if (funcs == NULL || funcs->mode_set_base_atomic == NULL) +#endif continue; if (drm_drv_uses_atomic_modeset(mode_set->crtc->dev))