Skip to content

Commit

Permalink
ggml : fix possible buffer use after free in sched reserve (#9930)
Browse files Browse the repository at this point in the history
  • Loading branch information
slaren authored Nov 17, 2024
1 parent 24203e9 commit eda7e1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ggml/src/ggml-backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1538,12 +1538,13 @@ bool ggml_backend_sched_reserve(ggml_backend_sched_t sched, struct ggml_cgraph *

ggml_backend_sched_split_graph(sched, measure_graph);

ggml_backend_sched_synchronize(sched);

if (!ggml_gallocr_reserve_n(sched->galloc, &sched->graph, sched->node_backend_ids, sched->leaf_backend_ids)) {
return false;
}

ggml_backend_sched_reset(sched);
ggml_backend_sched_synchronize(sched);

return true;
}
Expand Down

0 comments on commit eda7e1d

Please sign in to comment.