Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3fa96268 authored by Dan Williams's avatar Dan Williams
Browse files

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: default avatarDan Williams <dan.j.williams@intel.com>
parent 979fccfb
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -238,7 +238,9 @@ static int nd_pfn_init(struct nd_pfn *nd_pfn)


	nd_pfn->pfn_sb = pfn_sb;
	nd_pfn->pfn_sb = pfn_sb;
	rc = nd_pfn_validate(nd_pfn);
	rc = nd_pfn_validate(nd_pfn);
	if (rc == 0 || rc == -EBUSY)
	if (rc == -ENODEV)
		/* no info block, do init */;
	else
		return rc;
		return rc;


	nd_region = to_nd_region(nd_pfn->dev.parent);
	nd_region = to_nd_region(nd_pfn->dev.parent);