diff options
author | Yuval Shaia <yuval.shaia@oracle.com> | 2018-12-21 16:40:18 +0200 |
---|---|---|
committer | Marcel Apfelbaum <marcel.apfelbaum@gmail.com> | 2018-12-22 11:09:56 +0200 |
commit | 305bdd7a57a52cf87f9bf3e85316b0f62fe7167c (patch) | |
tree | 152ddd6b521049e822b3fe82b9e9e4eb1438fef1 /hw/rdma | |
parent | 46462cb1618e0a1e0a14e13bc08ffd02bc5f773e (diff) |
hw/rdma: Abort send-op if fail to create addr handler
Function create_ah might return NULL, let's exit with an error.
Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Diffstat (limited to 'hw/rdma')
-rw-r--r-- | hw/rdma/rdma_backend.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c index d7a4bbd91f..1e148398a2 100644 --- a/hw/rdma/rdma_backend.c +++ b/hw/rdma/rdma_backend.c @@ -338,6 +338,10 @@ void rdma_backend_post_send(RdmaBackendDev *backend_dev, if (qp_type == IBV_QPT_UD) { wr.wr.ud.ah = create_ah(backend_dev, qp->ibpd, backend_dev->backend_gid_idx, dgid); + if (!wr.wr.ud.ah) { + comp_handler(IBV_WC_GENERAL_ERR, VENDOR_ERR_FAIL_BACKEND, ctx); + goto out_dealloc_cqe_ctx; + } wr.wr.ud.remote_qpn = dqpn; wr.wr.ud.remote_qkey = dqkey; } |