From e8e016e126e38c3114734220768a743a1228d62a Mon Sep 17 00:00:00 2001 From: Anitha Raj Date: Tue, 23 Jan 2024 13:14:37 +0000 Subject: Fix for unchecked return value detected in Coverity checks. Resolves: COMPMID-6753 Signed-off-by: Anitha Raj Change-Id: I80df0479eb4c7cc2c5380df708844cc9ffdd2aed Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/11001 Reviewed-by: Gunes Bayir Comments-Addressed: Arm Jenkins Benchmark: Arm Jenkins Tested-by: Arm Jenkins --- src/core/CL/OpenCL.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/CL/OpenCL.cpp b/src/core/CL/OpenCL.cpp index 07baa5e7fb..2ebc3274aa 100644 --- a/src/core/CL/OpenCL.cpp +++ b/src/core/CL/OpenCL.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2023 Arm Limited. + * Copyright (c) 2017-2024 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -196,7 +196,11 @@ bool CLSymbols::load(const std::vector &libraries_filenames, bool u // functions. constexpr unsigned int num_platforms = 1U; std::vector platform_ids(num_platforms); - clGetPlatformIDs(num_platforms, platform_ids.data(), nullptr); + cl_int err = clGetPlatformIDs(num_platforms, platform_ids.data(), nullptr); + if (err != CL_SUCCESS) + { + return false; + } // Command buffer and mutable dispatch command buffer extensions /// TODO: (COMPMID-6742) Load Command Buffer extensions in a Portable way -- cgit v1.2.1