Skip to content

Commit

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

Required-githooks: true
Signed-off-by: Wang Shilong <[email protected]>
  • Loading branch information
wangshilong committed Dec 10, 2024
1 parent 04f68a6 commit 330ed65
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
Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit 330ed65

Please sign in to comment.