Skip to content

Commit

Permalink
Merge pull request #1435 from Kamalheib/qedr
Browse files Browse the repository at this point in the history
providers/qedr: Fix qelr_alloc_context error flow
  • Loading branch information
rleon committed Mar 3, 2024
2 parents fa69670 + 7ffc47d commit db730b4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions providers/qedr/qelr_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static struct verbs_context *qelr_alloc_context(struct ibv_device *ibdev,
ctx->srq_table = calloc(QELR_MAX_SRQ_ID, sizeof(*ctx->srq_table));
if (!ctx->srq_table) {
DP_ERR(ctx->dbg_fp, "failed to allocate srq_table\n");
return NULL;
goto cmd_err;
}

ctx->kernel_page_size = sysconf(_SC_PAGESIZE);
Expand Down Expand Up @@ -257,11 +257,14 @@ static struct verbs_context *qelr_alloc_context(struct ibv_device *ibdev,
DP_ERR(ctx->dbg_fp,
"alloc context: doorbell mapping failed resp.db_pa = %llx resp.db_size=%d context->cmd_fd=%d errno=%d\n",
resp.db_pa, resp.db_size, cmd_fd, errsv);
goto cmd_err;
goto free_srq_tbl;
}

return &ctx->ibv_ctx;

free_srq_tbl:
free(ctx->srq_table);

cmd_err:
qelr_err("%s: Failed to allocate context for device.\n", __func__);
qelr_close_debug_file(ctx);
Expand Down

0 comments on commit db730b4

Please sign in to comment.