From edc1821bd5d95fefe63e6727d99a75c30f1bcb7d Mon Sep 17 00:00:00 2001 From: Ewan Crawford Date: Wed, 20 Mar 2024 13:19:53 +0000 Subject: [PATCH] [Cmd-Buf][L0] Fix Coverity unsigned comparison report Fixes Coverity defect report from L0 command-buffer update code merged in https://github.com/oneapi-src/unified-runtime/pull/1353 ``` This greater-than-or-equal-to-zero comparison of an unsigned value is always true. "CommandDesc->newWorkDim >= 0U". ``` --- source/adapters/level_zero/command_buffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/adapters/level_zero/command_buffer.cpp b/source/adapters/level_zero/command_buffer.cpp index 36cf76d111..d38bac92f6 100644 --- a/source/adapters/level_zero/command_buffer.cpp +++ b/source/adapters/level_zero/command_buffer.cpp @@ -1030,7 +1030,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp( UR_ASSERT(Command, UR_RESULT_ERROR_INVALID_NULL_HANDLE); UR_ASSERT(Command->Kernel, UR_RESULT_ERROR_INVALID_NULL_HANDLE); UR_ASSERT(CommandDesc, UR_RESULT_ERROR_INVALID_NULL_POINTER); - UR_ASSERT(CommandDesc->newWorkDim >= 0 && CommandDesc->newWorkDim <= 3, + UR_ASSERT(CommandDesc->newWorkDim <= 3, UR_RESULT_ERROR_INVALID_WORK_DIMENSION); // Lock command, kernel and command buffer for update.