drm: Branch 'master'

[email protected] (GitLab Mirror) Mon, 30 Jul 2018 10:24:16 +0000 (UTC)
Newsgroups gmane.comp.video.dri.patches
Message-ID <[email protected]>
 xf86drm.c |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 4519db23ef716f37f804485f50955c26c38a6ae6
Author: Mariusz Ceier <[email protected]>
Date:   Sun Jul 29 10:20:14 2018 +0200

    xf86drm: Fix error path in drmGetDevice2
    
    In drmGetDevice2 when no local device is found or when
    drm_device_has_rdev filters out all devices, *device might be left
    uninitialized causing drmGetDevice2 to not return error - since
    it's only returned when *device == NULL.
    
    Above leads to crash in the firefox in system with amdgpu.
    
    With this change firefox displays:
    
    libGL error: MESA-LOADER: failed to retrieve device information
    libGL error: unable to load driver: amdgpu_dri.so
    libGL error: driver pointer missing
    libGL error: failed to load driver: amdgpu
    libGL error: MESA-LOADER: failed to retrieve device information
    libGL error: unable to load driver: amdgpu_dri.so
    libGL error: driver pointer missing
    libGL error: failed to load driver: amdgpu
    
    and doesn't crash.
    
    Bugzilla: https://bugs.freedesktop.org/107384
    Reviewed-by: Michel Dänzer <[email protected]>
    Signed-off-by: Mariusz Ceier <[email protected]>

diff --git a/xf86drm.c b/xf86drm.c
index 1e621e99..336d64de 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -3935,6 +3935,8 @@ int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device)
 
     drmFoldDuplicatedDevices(local_devices, node_count);
 
+    *device = NULL;
+
     for (i = 0; i < node_count; i++) {
         if (!local_devices[i])
             continue;

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--
_______________________________________________
Dri-patches mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-patches