Skip to content

Commit

Permalink
libnvdimm, pfn: fix nd_pfn_validate() return value handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Williams committed Dec 24, 2015
1 parent 979fccf commit 3fa9626
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/nvdimm/pmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3fa9626

Please sign in to comment.