diff options
author | Amit Engel <amit.engel@dell.com> | 2022-08-01 20:40:39 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2022-08-10 16:05:10 +0200 |
commit | ec9e96b5230148294c7abcaf3a4c592d3720b62d (patch) | |
tree | db5625c9b95fdb8d0f1cff87b002fdb75e84bb80 /drivers/nvme | |
parent | nvmet-auth: use kmemdup instead of kmalloc + memcpy (diff) | |
download | linux-ec9e96b5230148294c7abcaf3a4c592d3720b62d.tar.xz linux-ec9e96b5230148294c7abcaf3a4c592d3720b62d.zip |
nvme-fabrics: parse nvme connect Linux error codes
This fixes the assumption that errval is an unsigned nvme error
Signed-off-by: Amit Engel <amit.engel@dell.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/host/fabrics.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c index 5207a2348257..83b505358859 100644 --- a/drivers/nvme/host/fabrics.c +++ b/drivers/nvme/host/fabrics.c @@ -270,6 +270,12 @@ static void nvmf_log_connect_error(struct nvme_ctrl *ctrl, { int err_sctype = errval & ~NVME_SC_DNR; + if (errval < 0) { + dev_err(ctrl->device, + "Connect command failed, errno: %d\n", errval); + return; + } + switch (err_sctype) { case NVME_SC_CONNECT_INVALID_PARAM: if (offset >> 16) { |