diff options
author | Dan Williams <dan.j.williams@intel.com> | 2015-12-13 22:35:52 +0300 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2015-12-24 23:20:19 +0300 |
commit | 3fa962686568a1617d174e3d2f5d522e963077c5 (patch) | |
tree | d4ae4c23a88575384d60cba1663ac61363037d75 /drivers/nvdimm | |
parent | 979fccfb7348dbd968daf0249aa484a0297f83df (diff) | |
download | linux-3fa962686568a1617d174e3d2f5d522e963077c5.tar.xz |
libnvdimm, pfn: fix nd_pfn_validate() return value handling
The -ENODEV case indicates that the info-block needs to established.
All other return codes cause nd_pfn_init() to abort.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm')
-rw-r--r-- | drivers/nvdimm/pmem.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index dc6866734f70..ab689bca727d 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -238,7 +238,9 @@ static int nd_pfn_init(struct nd_pfn *nd_pfn) nd_pfn->pfn_sb = pfn_sb; rc = nd_pfn_validate(nd_pfn); - if (rc == 0 || rc == -EBUSY) + if (rc == -ENODEV) + /* no info block, do init */; + else return rc; nd_region = to_nd_region(nd_pfn->dev.parent); |