From 4cf3bb6a0494067168662ee3cf73dec7cf766827 Mon Sep 17 00:00:00 2001 From: T J Vivek Vilvaraj Date: Fri, 12 Feb 2021 19:37:00 +0000 Subject: [PATCH] sysman: fix unintialized pointer access in firmware module Signed-off-by: T J Vivek Vilvaraj --- .../tools/source/sysman/firmware/linux/os_firmware_imp.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/level_zero/tools/source/sysman/firmware/linux/os_firmware_imp.cpp b/level_zero/tools/source/sysman/firmware/linux/os_firmware_imp.cpp index 2599736e45..27f0988085 100644 --- a/level_zero/tools/source/sysman/firmware/linux/os_firmware_imp.cpp +++ b/level_zero/tools/source/sysman/firmware/linux/os_firmware_imp.cpp @@ -34,8 +34,11 @@ ze_result_t OsFirmware::getSupportedFwTypes(std::vector &supportedF return ZE_RESULT_SUCCESS; } bool LinuxFirmwareImp::isFirmwareSupported(void) { - isFWInitalized = ((ZE_RESULT_SUCCESS == pFwInterface->fwDeviceInit()) ? true : false); - return this->isFWInitalized; + if (pFwInterface != nullptr) { + isFWInitalized = ((ZE_RESULT_SUCCESS == pFwInterface->fwDeviceInit()) ? true : false); + return this->isFWInitalized; + } + return false; } void LinuxFirmwareImp::osGetFwProperties(zes_firmware_properties_t *pProperties) {