qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/rdma: Abort send-op if fail to create addr handler
@ 2018-08-14 10:00 Yuval Shaia
  2018-08-16  6:29 ` no-reply
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Yuval Shaia @ 2018-08-14 10:00 UTC (permalink / raw)
  To: qemu-devel, yuval.shaia, marcel.apfelbaum

Function create_ah might return NULL, let's exit with an error.

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
---
 hw/rdma/rdma_backend.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c
index 35726bda2e..59d02eb567 100644
--- a/hw/rdma/rdma_backend.c
+++ b/hw/rdma/rdma_backend.c
@@ -402,6 +402,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, 0);
+            goto out_dealloc_cqe_ctx;
+        }
         wr.wr.ud.remote_qpn = dqpn;
         wr.wr.ud.remote_qkey = dqkey;
     }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-08-18 13:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-14 10:00 [Qemu-devel] [PATCH] hw/rdma: Abort send-op if fail to create addr handler Yuval Shaia
2018-08-16  6:29 ` no-reply
2018-08-16  8:56 ` Yuval Shaia
2018-08-16  8:57 ` Marcel Apfelbaum
2018-08-17  6:38 ` no-reply
2018-08-18 13:46 ` Marcel Apfelbaum
2018-08-18 13:58   ` Yuval Shaia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).