提交 82305f82 编写于 作者: B Bart Van Assche 提交者: Doug Ledford

RDMA/srpt: Rework the srpt_alloc_srq() error path

This patch does not change any functionality but makes the next patch
easier to read.

Cc: Sergey Gorenko <sergeygo@mellanox.com>
Cc: Max Gurtovoy <maxg@mellanox.com>
Cc: Laurence Oberman <loberman@redhat.com>
Signed-off-by: NBart Van Assche <bvanassche@acm.org>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 6feb64ff
......@@ -2942,10 +2942,8 @@ static int srpt_alloc_srq(struct srpt_device *sdev)
srpt_alloc_ioctx_ring(sdev, sdev->srq_size,
sizeof(*sdev->ioctx_ring[0]),
srp_max_req_size, DMA_FROM_DEVICE);
if (!sdev->ioctx_ring) {
ib_destroy_srq(srq);
return -ENOMEM;
}
if (!sdev->ioctx_ring)
goto free_srq;
sdev->use_srq = true;
sdev->srq = srq;
......@@ -2956,6 +2954,10 @@ static int srpt_alloc_srq(struct srpt_device *sdev)
}
return 0;
free_srq:
ib_destroy_srq(srq);
return -ENOMEM;
}
static int srpt_use_srq(struct srpt_device *sdev, bool use_srq)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册