Message ID | 20181108160818.5485-5-yuval.shaia@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Add support for RDMA MAD | expand |
On 11/8/18 6:08 PM, Yuval Shaia wrote: > 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 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; > } Reviewed-by: Marcel Apfelbaum<marcel.apfelbaum@gmail.com> Thanks, Marcel
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; }
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(+)