[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1631181021-108687-1-git-send-email-jiapeng.chong@linux.alibaba.com>
Date: Thu, 9 Sep 2021 17:50:21 +0800
From: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
To: kbusch@...nel.org
Cc: axboe@...com, hch@....de, sagi@...mberg.me,
linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org,
chongjiapeng <jiapeng.chong@...ux.alibaba.com>
Subject: [PATCH] nvme: Fix missing error code in nvme_configure_directives()
From: chongjiapeng <jiapeng.chong@...ux.alibaba.com>
The error code is missing in this code scenario, add the error code
'-EINVAL' to the return value 'ret'.
Eliminate the follow smatch warning:
drivers/nvme/host/core.c:786 nvme_configure_directives() warn: missing
error code 'ret'.
Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
Fixes: f5d118406247 ("nvme: add support for streams and directives")
Signed-off-by: chongjiapeng <jiapeng.chong@...ux.alibaba.com>
---
drivers/nvme/host/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 7efb31b..84abf1f 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -783,6 +783,7 @@ static int nvme_configure_directives(struct nvme_ctrl *ctrl)
if (ctrl->nssa < BLK_MAX_WRITE_HINTS - 1) {
dev_info(ctrl->device, "too few streams (%u) available\n",
ctrl->nssa);
+ ret = -EINVAL;
goto out_disable_stream;
}
--
1.8.3.1
Powered by blists - more mailing lists