Skip to content

Commit 23edce8

Browse files
committed
Dereference after null check
1 parent 6d052b6 commit 23edce8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/softmax_kernel.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <limits>
1212
#include <type_traits>
1313

14+
#include "openvino/core/except.hpp"
1415
#include "openvino/core/type/bfloat16.hpp"
1516
#include "openvino/core/type/element_type.hpp"
1617
#include "openvino/core/type/float16.hpp"
@@ -1117,6 +1118,9 @@ inline void attn_softmax_kernel<float>(float* a,
11171118
scale_add2_reduce_max<true, true, true>};
11181119
int dispatch = (alibi ? 0b100 : 0) | (attn_mask ? 0b010 : 0) | (causal_mask ? 0b001 : 0);
11191120
float max = std::numeric_limits<float>::lowest();
1121+
OPENVINO_ASSERT(alibi, "CPU: alibi should not be nullptr in attn_softmax_kernel<float>.");
1122+
OPENVINO_ASSERT(attn_mask, "CPU: attn_mask should not be nullptr in attn_softmax_kernel<float>.");
1123+
OPENVINO_ASSERT(causal_mask, "CPU: causal_mask should not be nullptr in attn_softmax_kernel<float>.");
11201124
if (attn_mask_prec == ov::element::f32) {
11211125
funcs_fp32[dispatch](a,
11221126
scale,

0 commit comments

Comments
 (0)