diff options
author | Dan Williams <dan.j.williams@intel.com> | 2018-06-18 13:07:35 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2018-06-28 21:21:30 -0400 |
commit | b62cc6fdd793eaac50e4191c8637ffff9e9574d6 (patch) | |
tree | 0fb9070a2031d2cdf9367d7c7fb8f82adc90e17c | |
parent | 7daf201d7fe8334e2d2364d4e8ed3394ec9af819 (diff) |
libnvdimm, pmem: Fix memcpy_mcsafe() return code handling in nsio_rw_bytes()
Commit 60622d68227d "x86/asm/memcpy_mcsafe: Return bytes remaining"
converted callers of memcpy_mcsafe() to expect a positive 'bytes
remaining' value rather than a negative error code. The nsio_rw_bytes()
conversion failed to return success. The failure is benign in that
nsio_rw_bytes() will end up writing back what it just read.
Fixes: 60622d68227d ("x86/asm/memcpy_mcsafe: Return bytes remaining")
Cc: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | drivers/nvdimm/claim.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c index 2e96b34bc936..fb667bf469c7 100644 --- a/drivers/nvdimm/claim.c +++ b/drivers/nvdimm/claim.c | |||
@@ -278,6 +278,7 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns, | |||
278 | return -EIO; | 278 | return -EIO; |
279 | if (memcpy_mcsafe(buf, nsio->addr + offset, size) != 0) | 279 | if (memcpy_mcsafe(buf, nsio->addr + offset, size) != 0) |
280 | return -EIO; | 280 | return -EIO; |
281 | return 0; | ||
281 | } | 282 | } |
282 | 283 | ||
283 | if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) { | 284 | if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) { |