From 6234a1b2652f469071c0c9b0d8b0f4a8079efe74 Mon Sep 17 00:00:00 2001 From: Likun Gao Date: Fri, 30 Oct 2020 12:23:20 +0800 Subject: Fix drmmode_crtc_scanout_create logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If crtc scanout create successfully, the function of drmmode_crtc_scanout_create should return TURE. This will fix the regression caused by commit: "Make drmmode_crtc_scanout_create/destroy static" (442efe73), as it will result to some function (such as drmmode_set_scanout_pixmap) go to wrong code path and result to NULL pointer. Fixes: 442efe73 ("Make drmmode_crtc_scanout_create/destroy static") Signed-off-by: Likun Gao Reviewed-by: Michel Dänzer --- src/drmmode_display.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index f74106e..465915f 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -513,9 +513,10 @@ drmmode_crtc_scanout_create(xf86CrtcPtr crtc, PixmapPtr *scanout, ErrorF("failed to create CRTC scanout FB\n"); error: drmmode_crtc_scanout_destroy(scanout); + return FALSE; } - return FALSE; + return TRUE; } static void -- cgit v1.2.1