public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH libdrm 1/2] Return an -ENODEV from drmGetDevice() when no device was found.
@ 2016-10-21 17:12 Eric Anholt
  2016-10-21 17:12 ` [PATCH libdrm 2/2] Silence runtime complaints on platform devices Eric Anholt
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Eric Anholt @ 2016-10-21 17:12 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-kernel, Rob Herring, Eric Anholt

From: Rob Herring <robh@kernel.org>

Fixes crashes in Mesa on platform device, 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>
---
 xf86drm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xf86drm.c b/xf86drm.c
index 9cfca49ddfda..9b52889e4cef 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -3181,6 +3181,8 @@ int drmGetDevice(int fd, drmDevicePtr *device)
 
     closedir(sysdir);
     free(local_devices);
+    if (*device == NULL)
+	return -ENODEV;
     return 0;
 
 free_devices:
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-10-24 16:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-21 17:12 [PATCH libdrm 1/2] Return an -ENODEV from drmGetDevice() when no device was found Eric Anholt
2016-10-21 17:12 ` [PATCH libdrm 2/2] Silence runtime complaints on platform devices Eric Anholt
2016-10-21 17:32   ` Alex Deucher
2016-10-24 11:11   ` Emil Velikov
2016-10-24 16:35     ` Eric Anholt
2016-10-21 17:24 ` [PATCH libdrm 1/2] Return an -ENODEV from drmGetDevice() when no device was found Alex Deucher
2016-10-21 17:31 ` Emil Velikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox