nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvdimm: Fix missing error code in btt_read_pg()
@ 2021-06-04 10:24 Jiapeng Chong
  0 siblings, 0 replies; only message in thread
From: Jiapeng Chong @ 2021-06-04 10:24 UTC (permalink / raw)
  To: dan.j.williams
  Cc: vishal.l.verma, dave.jiang, ira.weiny, nvdimm, linux-kernel,
	Jiapeng Chong

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;
 			}
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-04 10:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-04 10:24 [PATCH] nvdimm: Fix missing error code in btt_read_pg() Jiapeng Chong

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