Message ID | 20180724084510.6104-2-yehs2007@zoho.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Do not request a pointer kaddr when not required | expand |
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 9d71492..b1d121a 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -232,7 +232,9 @@ __weak long __pmem_direct_access(struct pmem_device *pmem, pgoff_t pgoff, if (unlikely(is_bad_pmem(&pmem->bb, PFN_PHYS(pgoff) / 512, PFN_PHYS(nr_pages)))) return -EIO; - *kaddr = pmem->virt_addr + offset; + + if (kaddr) + *kaddr = pmem->virt_addr + offset; *pfn = phys_to_pfn_t(pmem->phys_addr + offset, pmem->pfn_flags); /*