Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[NPU] Fix coverity issue (#26374)

Xin Wang733024022aa0
diff --git a/src/plugins/intel_npu/src/compiler/src/driver_compiler_adapter.cpp b/src/plugins/intel_npu/src/compiler/src/driver_compiler_adapter.cpp
index e7d955c4345..a25b7e4c015 100644
--- a/src/plugins/intel_npu/src/compiler/src/driver_compiler_adapter.cpp
+++ b/src/plugins/intel_npu/src/compiler/src/driver_compiler_adapter.cpp
@@ -106,13 +106,13 @@ std::vector<ov::ProfilingInfo> LevelZeroCompilerAdapter::process_profiling_outpu
void LevelZeroCompilerAdapter::release(std::shared_ptr<const NetworkDescription> networkDescription) {
_logger.info("release - using adapter to release networkDescription");
- apiAdapter->release(networkDescription);
+ apiAdapter->release(std::move(networkDescription));
}
std::vector<uint8_t> LevelZeroCompilerAdapter::getCompiledNetwork(
std::shared_ptr<const NetworkDescription> networkDescription) {
_logger.info("getCompiledNetwork - using adapter to perform getCompiledNetwork(networkDescription)");
- return apiAdapter->getCompiledNetwork(networkDescription);
+ return apiAdapter->getCompiledNetwork(std::move(networkDescription));
}
} // namespace driverCompilerAdapter
diff --git a/src/plugins/intel_npu/src/plugin/src/compiler.cpp b/src/plugins/intel_npu/src/plugin/src/compiler.cpp
index d772de84023..6b5a5e11276 100644
--- a/src/plugins/intel_npu/src/plugin/src/compiler.cpp
+++ b/src/plugins/intel_npu/src/plugin/src/compiler.cpp
@@ -78,7 +78,7 @@ ov::SoPtr<ICompiler> createCompilerImpl(std::shared_ptr<NPUBackends> npuBackends
case ov::intel_npu::CompilerType::MLIR:
return createNPUCompiler(log);
case ov::intel_npu::CompilerType::DRIVER:
- return createCompilerAdapter(npuBackends, log);
+ return createCompilerAdapter(std::move(npuBackends), log);
default:
OPENVINO_THROW("Invalid NPU_COMPILER_TYPE");
}
@@ -92,7 +92,7 @@ ov::SoPtr<ICompiler> intel_npu::createCompiler(std::shared_ptr<intel_npu::NPUBac
auto logger = Logger::global().clone("createCompiler");
try {
logger.debug("performing createCompilerImpl");
- return createCompilerImpl(npuBackends, compilerType, logger);
+ return createCompilerImpl(std::move(npuBackends), compilerType, logger);
} catch (const std::exception& ex) {
OPENVINO_THROW("Got an error during compiler creation: ", ex.what());
} catch (...) {