mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-29 02:10:12 +01:00
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 <michel.daenzer@amd.com> Signed-off-by: Mariusz Ceier <mceier+mesa-dev@gmail.com>
This commit is contained in:
parent
9c979e0ec4
commit
4519db23ef
1 changed files with 2 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue