From: Max Gurtovoy Date: Sun, 17 Oct 2021 08:58:16 +0000 (+0300) Subject: nvme-rdma: fix error code in nvme_rdma_setup_ctrl X-Git-Tag: v6.6.17~8867^2~48^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=09748122009aed7bfaa7acc33c10c083a4758322;p=platform%2Fkernel%2Flinux-rpi.git 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 Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig --- diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index 5ba386f..9317f26 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -1096,11 +1096,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;