Merge tag 'libnvdimm-for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm...
[linux-2.6-microblaze.git] / drivers / nvdimm / claim.c
index 26c1c76..2985ca9 100644 (file)
@@ -255,7 +255,7 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
        struct nd_namespace_io *nsio = to_nd_namespace_io(&ndns->dev);
        unsigned int sz_align = ALIGN(size + (offset & (512 - 1)), 512);
        sector_t sector = offset >> 9;
-       int rc = 0;
+       int rc = 0, ret = 0;
 
        if (unlikely(!size))
                return 0;
@@ -293,7 +293,9 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
        }
 
        memcpy_flushcache(nsio->addr + offset, buf, size);
-       nvdimm_flush(to_nd_region(ndns->dev.parent));
+       ret = nvdimm_flush(to_nd_region(ndns->dev.parent), NULL);
+       if (ret)
+               rc = ret;
 
        return rc;
 }