From c05049b4205e446a2e319ab620a5ca949c7a7380 Mon Sep 17 00:00:00 2001 From: Tom St Denis Date: Tue, 17 Nov 2015 10:58:36 -0500 Subject: [PATCH] amdgpu: Make amdgpu_cs_calculate_timeout() return something sensible on error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tom St Denis Reviewed-by: Christian König --- amdgpu/amdgpu_cs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index aa594c44..6747158c 100644 --- a/amdgpu/amdgpu_cs.c +++ b/amdgpu/amdgpu_cs.c @@ -291,8 +291,10 @@ drm_private uint64_t amdgpu_cs_calculate_timeout(uint64_t timeout) struct timespec current; uint64_t current_ns; r = clock_gettime(CLOCK_MONOTONIC, ¤t); - if (r) - return r; + if (r) { + fprintf(stderr, "clock_gettime() returned error (%d)!", errno); + return AMDGPU_TIMEOUT_INFINITE; + } current_ns = ((uint64_t)current.tv_sec) * 1000000000ull; current_ns += current.tv_nsec;