nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
To: dan.j.williams@intel.com
Cc: vishal.l.verma@intel.com, dave.jiang@intel.com,
	ira.weiny@intel.com, nvdimm@lists.linux.dev,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Subject: [PATCH] nvdimm: Fix missing error code in btt_read_pg()
Date: Fri,  4 Jun 2021 18:24:09 +0800	[thread overview]
Message-ID: <1622802249-45353-1-git-send-email-jiapeng.chong@linux.alibaba.com> (raw)

When we failed to get e_flag, the return value of btt_read_pg() is -EIO,
but when we failed to get t_flag, the return value of the btt_read_pg()
is '0' above. So We set ret to -EIO in this case.

Eliminate the follow smatch warning:

drivers/nvdimm/btt.c:1234 btt_read_pg() warn: missing error code 'ret'.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
 drivers/nvdimm/btt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
index 92dec49..44f5b666 100644
--- a/drivers/nvdimm/btt.c
+++ b/drivers/nvdimm/btt.c
@@ -1231,6 +1231,7 @@ static int btt_read_pg(struct btt *btt, struct bio_integrity_payload *bip,
 			if (t_flag) {
 				zero_fill_data(page, off, cur_len);
+				ret = -EIO;
 				goto out_lane;

                 reply	other threads:[~2021-06-04 10:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1622802249-45353-1-git-send-email-jiapeng.chong@linux.alibaba.com \
    --to=jiapeng.chong@linux.alibaba.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=vishal.l.verma@intel.com \
    --subject='Re: [PATCH] nvdimm: Fix missing error code in btt_read_pg()' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).