Skip to content

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

[NPU] Fix coverity issues (#35539)

Alexandru Enache3972f683713a
diff --git a/src/plugins/intel_npu/src/plugin/src/properties.cpp b/src/plugins/intel_npu/src/plugin/src/properties.cpp
index 38871a550c1..84d0663012d 100644
--- a/src/plugins/intel_npu/src/plugin/src/properties.cpp
+++ b/src/plugins/intel_npu/src/plugin/src/properties.cpp
@@ -628,9 +628,11 @@ void Properties::registerPluginProperties() {
REGISTER_SIMPLE_METRIC(ov::device::pci_info, true, _metrics->GetPciInfo(get_specified_device_name(config)));
REGISTER_SIMPLE_METRIC(ov::device::gops, true, _metrics->GetGops(get_specified_device_name(config)));
REGISTER_SIMPLE_METRIC(ov::device::type, true, _metrics->GetDeviceType(get_specified_device_name(config)));
- REGISTER_CUSTOM_METRIC(ov::internal::supported_properties, false, [&](const Config&) {
- return _internalSupportedProperties;
- });
+ REGISTER_CUSTOM_METRIC(ov::internal::supported_properties,
+ false,
+ [&](const Config&) -> const std::vector<ov::PropertyName>& {
+ return _internalSupportedProperties;
+ });
REGISTER_SIMPLE_METRIC(ov::internal::cache_header_alignment, false, utils::STANDARD_PAGE_SIZE);
REGISTER_SIMPLE_METRIC(ov::intel_npu::device_alloc_mem_size,
true,
@@ -866,7 +868,7 @@ ov::Any Properties::getProperty(const std::string& name) {
registerProperties();
_compilerConfigsFilteredByCompiler = true;
_currentlyUsedCompiler = compilerType;
- _currentlyUsedPlatform = compilationPlatform;
+ _currentlyUsedPlatform = std::move(compilationPlatform);
}
}
}
@@ -935,7 +937,7 @@ void Properties::setProperty(const ov::AnyMap& properties) {
registerProperties();
_compilerConfigsFilteredByCompiler = true;
_currentlyUsedCompiler = compilerType;
- _currentlyUsedPlatform = compilationPlatform;
+ _currentlyUsedPlatform = std::move(compilationPlatform);
}
}
}
@@ -1096,7 +1098,7 @@ FilteredConfig Properties::getConfigForSpecificCompiler(const ov::AnyMap& proper
updatedConfig.update(cfgsToSet);
- return updatedConfig;
+ return std::move(updatedConfig);
}
FilteredConfig Properties::getConfigWithCompilerPropertiesDisabled(const ov::AnyMap& properties) {
diff --git a/src/plugins/intel_npu/src/plugin/src/transformations.cpp b/src/plugins/intel_npu/src/plugin/src/transformations.cpp
index ce3ff26717b..76209886014 100644
--- a/src/plugins/intel_npu/src/plugin/src/transformations.cpp
+++ b/src/plugins/intel_npu/src/plugin/src/transformations.cpp
@@ -248,7 +248,7 @@ std::tuple<std::shared_ptr<ov::Model>, bool> handlePluginBatching(
}
} catch (const std::exception& ex) {
// If plugin-side transformation failed, keep the original model and drop the clone
- reshapedModel = originalModel;
+ reshapedModel = std::move(originalModel);
if (batchMode == ov::intel_npu::BatchMode::AUTO) {
logger.info("Couldn't validate and reshape the model. Batching will be handled by compiler. Error: %s",
ex.what());