Skip to content

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

[NPU] Fix Coverity NULL_FIELD in patch_reshape_constants (CID 2555106) (#39020)

Alexandru Lorinti134038062bc9
diff --git a/src/plugins/intel_npu/src/plugin/npuw/attention.cpp b/src/plugins/intel_npu/src/plugin/npuw/attention.cpp
index 8322b9cc583..4d57f982bf0 100644
--- a/src/plugins/intel_npu/src/plugin/npuw/attention.cpp
+++ b/src/plugins/intel_npu/src/plugin/npuw/attention.cpp
@@ -65,6 +65,9 @@ void ov::npuw::function::patch_reshape_constants(const std::shared_ptr<ov::Model
auto patch_input = [&](const std::shared_ptr<ov::Node>& node, size_t sequence_axis) {
const auto matmul = ov::as_type_ptr<ov::op::v0::MatMul>(node);
+ if (!matmul) {
+ return;
+ }
auto current = matmul->input_value(1).get_node_shared_ptr();
while (current && !ov::is_type<ov::op::v1::Reshape>(current)) {
if (!ov::is_type<ov::op::v1::Transpose>(current) && !ov::is_type<ov::op::v0::Convert>(current) &&