From b8d64223261bab4305fdc940fb25229dc0e2cbd6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michel=20D=C3=A4nzer?= Date: Thu, 3 Oct 2024 17:33:56 +0200 Subject: [PATCH] cl: Don't use device_infos if num_device_infos == 0 valgrind pointed me to this, after I got seemingly random fails. Fixes: 4f2016b2d9f3 ("cl: clGetDeviceInfo check returned values") Part-of: --- tests/cl/api/get-device-info.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cl/api/get-device-info.c b/tests/cl/api/get-device-info.c index 9ddfad7f9..9e7123525 100644 --- a/tests/cl/api/get-device-info.c +++ b/tests/cl/api/get-device-info.c @@ -663,7 +663,7 @@ piglit_cl_test(const int argc, const cl_device_info *device_infos = device_infos_enum; - if (env->version >= 12) { + if (num_device_infos && env->version >= 12) { // for some check we need some infos to be read before others // piglit-util-cl-enum could be re ordered partially // the first 10 elements are ok, @@ -772,7 +772,7 @@ piglit_cl_test(const int argc, piglit_merge_result(&result, PIGLIT_FAIL); } - if (env->version >= 12) { + if (num_device_infos && env->version >= 12) { free((void*)device_infos); } -- 2.11.4.GIT