nvme-rdma: fix error code in nvme_rdma_setup_ctrl
PATCH 1/1 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 c66e2998c8ca ("nvme-rdma: centralize controller setup sequence")
Signed-off-by Max Gurtovoy <[email protected]>
--- drivers/nvme/host/rdma.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/nvme/host/rdma.c +2 -0
@@ -1083,11 +1083,13 @@ static int nvme_rdma_setup_ctrl(struct nvme_rdma_ctrl *ctrl, bool new)return ret;if (ctrl->ctrl.icdoff) { + ret = -EOPNOTSUPP ;dev_err (ctrl->ctrl.device,"icdoff is not supported!\n" ); goto destroy_admin; }if (!(ctrl->ctrl.sgls & (1 <<2 ))) { + ret = -EOPNOTSUPP ;dev_err (ctrl->ctrl.device,"Mandatory keyed sgls are not supported!\n" ); goto destroy_admin;
Signature · 1 line
2.18.1
Reviewed-by Sagi Grimberg <[email protected]>
Thanks,
applied to nvme-5.16.