From: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
To: james.smart@broadcom.com, kbusch@kernel.org, axboe@fb.com,
hch@lst.de, sagi@grimberg.me, jthumshirn@suse.de,
james_p_freyensee@linux.intel.com
Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
tianjia.zhang@alibaba.com
Subject: [PATCH] nvme-fc: Fix wrong return value in __nvme_fc_init_request()
Date: Sun, 2 Aug 2020 19:15:45 +0800 [thread overview]
Message-ID: <20200802111545.5566-1-tianjia.zhang@linux.alibaba.com> (raw)
On an error exit path, a negative error code should be returned
instead of a positive return value.
Fixes: e399441de9115 ("nvme-fabrics: Add host support for FC transport")
Cc: James Smart <jsmart2021@gmail.com>
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
---
drivers/nvme/host/fc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index e999a8c4b7e8..2e06f8f4cff1 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -2075,7 +2075,7 @@ __nvme_fc_init_request(struct nvme_fc_ctrl *ctrl,
if (fc_dma_mapping_error(ctrl->lport->dev, op->fcp_req.cmddma)) {
dev_err(ctrl->dev,
"FCP Op failed - cmdiu dma mapping failed.\n");
- ret = EFAULT;
+ ret = -EFAULT;
goto out_on_error;
}
@@ -2085,7 +2085,7 @@ __nvme_fc_init_request(struct nvme_fc_ctrl *ctrl,
if (fc_dma_mapping_error(ctrl->lport->dev, op->fcp_req.rspdma)) {
dev_err(ctrl->dev,
"FCP Op failed - rspiu dma mapping failed.\n");
- ret = EFAULT;
+ ret = -EFAULT;
}
atomic_set(&op->state, FCPOP_STATE_IDLE);
--
2.26.2
next reply other threads:[~2020-08-02 11:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-02 11:15 Tianjia Zhang [this message]
2020-08-02 22:54 ` [PATCH] nvme-fc: Fix wrong return value in __nvme_fc_init_request() Chaitanya Kulkarni
2020-08-14 8:17 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200802111545.5566-1-tianjia.zhang@linux.alibaba.com \
--to=tianjia.zhang@linux.alibaba.com \
--cc=axboe@fb.com \
--cc=hch@lst.de \
--cc=james.smart@broadcom.com \
--cc=james_p_freyensee@linux.intel.com \
--cc=jthumshirn@suse.de \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
--cc=tianjia.zhang@alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).