summaryrefslogtreecommitdiffstats
path: root/drivers/nvme
diff options
context:
space:
mode:
authorMax Gurtovoy <mgurtovoy@nvidia.com>2021-10-17 11:58:16 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-11-26 11:36:10 +0100
commit66c0727e94b82792967a709643133fa21e458d9a (patch)
tree4f352ea88c90415ddd35b7bbdaa8e75d65363ee0 /drivers/nvme
parent456d6b503e1c2bb69f178d28070b58e4e4b01de3 (diff)
downloadlinux-stable-66c0727e94b82792967a709643133fa21e458d9a.tar.gz
linux-stable-66c0727e94b82792967a709643133fa21e458d9a.tar.bz2
linux-stable-66c0727e94b82792967a709643133fa21e458d9a.zip
nvme-rdma: fix error code in nvme_rdma_setup_ctrl
[ Upstream commit 09748122009aed7bfaa7acc33c10c083a4758322 ] 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 <mgurtovoy@nvidia.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/host/rdma.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index ffd6a7204509..1f41cf80f827 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -967,11 +967,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;