mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-25 00:10:11 +01:00
Return an -ENODEV from drmGetDevice() when no device was found.
Fixes crashes in Mesa on platform devices, which expected *device to have a device when 0 was returned. (code from a paste by Rob, commit message by anholt) Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
This commit is contained in:
parent
7dd28475f1
commit
677cd97dc4
1 changed files with 2 additions and 0 deletions
|
|
@ -3181,6 +3181,8 @@ int drmGetDevice(int fd, drmDevicePtr *device)
|
|||
|
||||
closedir(sysdir);
|
||||
free(local_devices);
|
||||
if (*device == NULL)
|
||||
return -ENODEV;
|
||||
return 0;
|
||||
|
||||
free_devices:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue