Re: [PATCH 4/5] nvmet-rdma: add a NVMe over Fabrics RDMA target driver

Ming Lin
2016-06-09T21:54:24Z

On Thu, Jun 9, 2016 at 2:42 PM, Steve Wise <swise@opengridcomputing.com> wrote:

> Should the above error path actually goto a block that frees the rsps? Like
> this?
>
> diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
> index c184ee5..8aaa36f 100644
> --- a/drivers/nvme/target/rdma.c
> +++ b/drivers/nvme/target/rdma.c
> @@ -1053,7 +1053,7 @@ nvmet_rdma_alloc_queue(struct nvmet_rdma_device *ndev,
> !queue->host_qid);
> if (IS_ERR(queue->cmds)) {
> ret = NVME_RDMA_CM_NO_RSC;
> - goto out_free_cmds;
> + goto out_free_responses;
> }
> }
>
> @@ -1073,6 +1073,8 @@ out_free_cmds:
> queue->recv_queue_size,
> !queue->host_qid);
> }
> +out_free_responses:
> + nvmet_rdma_free_rsps(queue);
> out_ida_remove:
> ida_simple_remove(&nvmet_rdma_queue_ida, queue->idx);
> out_destroy_sq:

Yes. Nice catch.