xserver: Branch 'master'

Keith Packard keithp at kemper.freedesktop.org
Thu May 22 16:28:15 PDT 2014


 hw/xfree86/dri2/dri2.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 3dba171f5e82101aa8ea2e47d2253c3410907f6a
Author: Michal Srb <msrb at suse.com>
Date:   Tue Apr 15 18:54:35 2014 +0300

    dri2: Fix detection of wrong prime_id in GetScreenPrime.
    
    Checking the iterating variable ("slave") against null can not detect if the
    xorg_list_for_each_entry finished without break being invoked - slave variable
    will be always non-null. This caused segfault whenever someone tried to use
    DRI_PRIME with incorrect id while having at least one render offloading slave
    configured.
    
    Restructurize the GetScreenPrime to work as expected.
    
    Reviewed-by: Dave Airlie <airlied at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 76708ca..6dd7796 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -156,11 +156,9 @@ GetScreenPrime(ScreenPtr master, int prime_id)
 
         ds = DRI2GetScreen(slave);
         if (ds->prime_id == prime_id)
-            break;
+            return slave;
     }
-    if (!slave)
-        return master;
-    return slave;
+    return master;
 }
 
 static DRI2ScreenPtr


More information about the xorg-commit mailing list