Re: [Mesa-dev] [PATCH] xf86drm: Fix error path in drmGetDevice2

2018-07-30 Thread Emil Velikov
On 30 July 2018 at 11:23, Michel Dänzer wrote: > On 2018-07-30 12:13 PM, Mariusz Ceier wrote: >> On 30 July 2018 at 11:31, Michel Dänzer wrote: >>> On 2018-07-29 10:20 AM, Mariusz Ceier wrote: In drmGetDevice2 when no local device is found or when drm_device_has_rdev filters out all

Re: [Mesa-dev] [PATCH] xf86drm: Fix error path in drmGetDevice2

2018-07-30 Thread Michel Dänzer
On 2018-07-30 12:13 PM, Mariusz Ceier wrote: > On 30 July 2018 at 11:31, Michel Dänzer wrote: >> On 2018-07-29 10:20 AM, Mariusz Ceier wrote: >>> In drmGetDevice2 when no local device is found or when >>> drm_device_has_rdev filters out all devices, *device might be left >>> uninitialized causing

Re: [Mesa-dev] [PATCH] xf86drm: Fix error path in drmGetDevice2

2018-07-30 Thread Mariusz Ceier
On 30 July 2018 at 11:31, Michel Dänzer wrote: > On 2018-07-29 10:20 AM, Mariusz Ceier wrote: >> 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

Re: [Mesa-dev] [PATCH] xf86drm: Fix error path in drmGetDevice2

2018-07-30 Thread Michel Dänzer
On 2018-07-29 10:20 AM, Mariusz Ceier wrote: > 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

Re: [Mesa-dev] [PATCH] xf86drm: Fix error path in drmGetDevice2

2018-07-29 Thread Mariusz Ceier
I think chasing all the invocations of drmGetDevice2 is wrong - since it's drmGetDevice2 that's broken, not the code that uses it. Code that uses drmGetDevice2 expects it to return error when device has not been found. If setting *device in error path is not good, the patch can be modified to not

Re: [Mesa-dev] [PATCH] xf86drm: Fix error path in drmGetDevice2

2018-07-29 Thread Christoph Haag
I've reported this here: https://bugs.freedesktop.org/show_bug.cgi?id=107384 The patch in the comments initializing drmDevicePtr device to NULL makes it work properly for me. I don't think the patch is on the mailing list yet. It's probably a good idea to check if there are more places where

[Mesa-dev] [PATCH] xf86drm: Fix error path in drmGetDevice2

2018-07-29 Thread Mariusz Ceier
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