Commit 09748122 authored by Max Gurtovoy's avatar Max Gurtovoy Committed by Christoph Hellwig

nvme-rdma: fix error code in nvme_rdma_setup_ctrl

In case that icdoff is not zero or mandatory keyed sgls are not
supported by the NVMe/RDMA target, we'll go to error flow but we'll
return 0 to the caller. Fix it by returning an appropriate error code.

Fixes: c66e2998 ("nvme-rdma: centralize controller setup sequence")
Signed-off-by: default avatarMax Gurtovoy <mgurtovoy@nvidia.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 11384580
...@@ -1096,11 +1096,13 @@ static int nvme_rdma_setup_ctrl(struct nvme_rdma_ctrl *ctrl, bool new) ...@@ -1096,11 +1096,13 @@ static int nvme_rdma_setup_ctrl(struct nvme_rdma_ctrl *ctrl, bool new)
return ret; return ret;
if (ctrl->ctrl.icdoff) { if (ctrl->ctrl.icdoff) {
ret = -EOPNOTSUPP;
dev_err(ctrl->ctrl.device, "icdoff is not supported!\n"); dev_err(ctrl->ctrl.device, "icdoff is not supported!\n");
goto destroy_admin; goto destroy_admin;
} }
if (!(ctrl->ctrl.sgls & (1 << 2))) { if (!(ctrl->ctrl.sgls & (1 << 2))) {
ret = -EOPNOTSUPP;
dev_err(ctrl->ctrl.device, dev_err(ctrl->ctrl.device,
"Mandatory keyed sgls are not supported!\n"); "Mandatory keyed sgls are not supported!\n");
goto destroy_admin; goto destroy_admin;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment