Skip to content

Commit

Permalink
DAOS-16867 object: fix error handling of ds_cpd_handle_one() (#15565)
Browse files Browse the repository at this point in the history
ABT_eventual_wait() might access freed eventual in error case.

Signed-off-by: Wang Shilong <[email protected]>
wangshilong authored Dec 18, 2024
1 parent b020347 commit f07e5da
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/object/srv_obj.c
Original file line number Diff line number Diff line change
@@ -4844,14 +4844,14 @@ ds_cpd_handle_one(crt_rpc_t *rpc, struct daos_cpd_sub_head *dcsh, struct daos_cp
out:
if (rc != 0) {
if (bulks != NULL) {
for (i = 0;
i < dcde->dcde_write_cnt && rma_idx < rma; i++) {
for (i = 0; i < dcde->dcde_write_cnt; i++) {
if (!bulks[i].inited)
continue;

ABT_eventual_wait(bulks[i].eventual, NULL);
ABT_eventual_free(&bulks[i].eventual);
rma_idx++;
if (bulks[i].eventual != ABT_EVENTUAL_NULL) {
ABT_eventual_wait(bulks[i].eventual, NULL);
ABT_eventual_free(&bulks[i].eventual);
}
}
}

0 comments on commit f07e5da

Please sign in to comment.