Fix for unchecked return value detected in Coverity checks.

Resolves: COMPMID-6753

Signed-off-by: Anitha Raj <anitha.raj@arm.com>
Change-Id: I80df0479eb4c7cc2c5380df708844cc9ffdd2aed
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/11001
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
diff --git a/src/core/CL/OpenCL.cpp b/src/core/CL/OpenCL.cpp
index 07baa5e..2ebc327 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 @@
     // functions.
     constexpr unsigned int      num_platforms = 1U;
     std::vector<cl_platform_id> 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