Skip to content

Commit 97681f9

Browse files
toshikanidjbw
authored andcommitted
libnvdimm: fix phys_addr for nvdimm_clear_poison
nvdimm_clear_poison() expects a physical address, not an offset. Fix nsio_rw_bytes() to call nvdimm_clear_poison() with a physical address. Signed-off-by: Toshi Kani <toshi.kani@hpe.com> Cc: Dave Jiang <dave.jiang@intel.com> Cc: Vishal Verma <vishal.l.verma@intel.com> Reviewed-by: Vishal Verma <vishal.l.verma@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent bc042fd commit 97681f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/nvdimm/claim.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
246246
if (IS_ALIGNED(offset, 512) && IS_ALIGNED(size, 512)) {
247247
long cleared;
248248

249-
cleared = nvdimm_clear_poison(&ndns->dev, offset, size);
249+
cleared = nvdimm_clear_poison(&ndns->dev,
250+
nsio->res.start + offset, size);
250251
if (cleared < size)
251252
rc = -EIO;
252253
if (cleared > 0 && cleared / 512) {

0 commit comments

Comments
 (0)