Skip to content

Commit

Permalink
graph: backend: dnnl: validate pointers before dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
TaoLv authored and vpirogov committed Jun 10, 2024
1 parent c5e5eb0 commit 5ea773e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/graph/backend/dnnl/kernels/sdp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,12 +639,13 @@ struct sdp_decomp_config_t {
subgraph_rewriter_t rewriter(sg);

for (const auto &cur_op : sg->get_ops()) {
if (cur_op->get_kind() != op_kind::dnnl_matmul) continue;
if (!cur_op || cur_op->get_kind() != op_kind::dnnl_matmul) continue;
auto post_op = get_post_op(cur_op);
if (post_op == nullptr
|| post_op->get_kind() != op_kind::dnnl_softmax)
if (!post_op || post_op->get_kind() != op_kind::dnnl_softmax)
continue;
auto ppost_op = get_post_op(post_op);
if (!ppost_op) return status::invalid_graph;

op_ptr reorder1;
op_ptr reorder2;
if (is_quantize) {
Expand Down

0 comments on commit 5ea773e

Please sign in to comment.