From 127af1a715017dbcc789c52f5cc076d525d6bf7c Mon Sep 17 00:00:00 2001 From: Jack Myers Date: Thu, 9 Jan 2025 02:25:53 +0000 Subject: [PATCH] fix: correct result variable scope in initDriver The `initDriver` function had an issue where a new `result` variable was defined in a lower scope, causing the initialization result to be discarded. This commit removes the redundant variable declaration, ensuring that the `result` variable initialized in the upper scope is correctly set by the `Driver::get()->initialize` method and properly reflects the driver initialization status. Related-To: NEO-13686 Signed-off-by: Jack Myers --- level_zero/core/source/driver/driver.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/level_zero/core/source/driver/driver.cpp b/level_zero/core/source/driver/driver.cpp index 41d99c7838..848da3f261 100644 --- a/level_zero/core/source/driver/driver.cpp +++ b/level_zero/core/source/driver/driver.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2024 Intel Corporation + * Copyright (C) 2020-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -159,7 +159,6 @@ ze_result_t initDriver() { std::lock_guard lock(driverInitMutex); if (Driver::get()->getPid() != pid) { - ze_result_t result; Driver::get()->initialize(&result); } }