Skip to contentSkip to conversation

nvdimm: Fix missing error code in btt_read_pg()

PATCH New Jiapeng Chong 1 participant 1 message Jun 4, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvdimm: Fix missing error code in btt_read_pg()

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

---
 drivers/nvdimm/btt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nvdimm/btt.c +1 -0
index 92dec49..44f5b666 100644
@@ -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;
 			}
 
Signature · 1 line
1.8.3.1