This is not a big issue to return -1 since the only codepath that uses
it is for display purposes.

Caught by Klockwork.

Signed-off-by: Martin Peres <[email protected]>
---
 src/intel_device.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/intel_device.c b/src/intel_device.c
index 54c1443..35e652a 100644
--- a/src/intel_device.c
+++ b/src/intel_device.c
@@ -650,7 +650,10 @@ int __intel_peek_fd(ScrnInfoPtr scrn)
        dev = intel_device(scrn);
        assert(dev && dev->fd != -1);
 
-       return dev->fd;
+       if (!dev)
+               return -1;
+       else
+               return dev->fd;
 }
 
 int intel_has_render_node(struct intel_device *dev)
-- 
2.7.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to