From ca38e5676761f3db9d3c2861cb9cd06f299401bb Mon Sep 17 00:00:00 2001 From: Dan Liu Date: Wed, 15 Jan 2025 17:11:45 +0800 Subject: [PATCH] [NPU] fix segfault in compile_tool (#28434) ### Details: - Fix `Segmentation fault (core dumped)` issue when running `compile_tool` without a device. ### Tickets: - *E151581* --- .../compiler_adapter/include/compiler_adapter_factory.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/intel_npu/src/compiler_adapter/include/compiler_adapter_factory.hpp b/src/plugins/intel_npu/src/compiler_adapter/include/compiler_adapter_factory.hpp index ff6dc6246a121d..a23ba2b5990299 100644 --- a/src/plugins/intel_npu/src/compiler_adapter/include/compiler_adapter_factory.hpp +++ b/src/plugins/intel_npu/src/compiler_adapter/include/compiler_adapter_factory.hpp @@ -19,14 +19,13 @@ class CompilerAdapterFactory final { auto compilerType = config.get(); switch (compilerType) { case ov::intel_npu::CompilerType::MLIR: { - if (engineBackend->getName() != "LEVEL0") { + if (engineBackend == nullptr || engineBackend->getName() != "LEVEL0") { return std::make_unique(nullptr); } - return std::make_unique(engineBackend->getInitStructs()); } case ov::intel_npu::CompilerType::DRIVER: { - if (engineBackend->getName() != "LEVEL0") { + if (engineBackend == nullptr || engineBackend->getName() != "LEVEL0") { OPENVINO_THROW("NPU Compiler Adapter must be used with LEVEL0 backend"); }