[Beignet] [PATCH] Don't crash if device inaccessible

Rebecca N. Palmer rebecca_palmer at zoho.com
Sat Mar 21 00:37:00 PDT 2015


If /dev/dri/cardX is inaccessible, return CL_DEVICE_NOT_FOUND,
don't assert-fail.

Signed-off-by: Rebecca Palmer <rebecca_palmer at zoho.com>

diff --git a/src/x11/dricommon.c b/src/x11/dricommon.c
index 03f542c..16f50e4 100644
--- a/src/x11/dricommon.c
+++ b/src/x11/dricommon.c
@@ -284,7 +284,6 @@ getDRI2State(Display* dpy, int screen, char **driver_name)
      goto err_out;
  
    fd = open(device_name, O_RDWR);
-  assert(fd >= 0);
  
    if (fd < 0)
      goto err_out;



More information about the Beignet mailing list