Skip to contentSkip to conversation

libnvdimm: fix error return code in __blk_label_update()

PATCH New Wei Yongjun 1 participant 1 message Oct 17, 2016 libnvdimm: non-volatile memory device

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libnvdimm: fix error return code in __blk_label_update()

From: Wei Yongjun <[email protected]>

Fix to return error code -ENXIO from the nd_label_alloc_slot() error handling case instead of 0, as done elsewhere in this function.

---
 drivers/nvdimm/label.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/nvdimm/label.c +3 -1
index fac7cab..ab2927c 100644
@@ -710,8 +710,10 @@ static int __blk_label_update(struct nd_region *nd_region,
 		if (is_old_resource(res, old_res_list, old_num_resources))
 			continue; /* carry-over */
 		slot = nd_label_alloc_slot(ndd);
-		if (slot == UINT_MAX)
+		if (slot == UINT_MAX) {
+			rc = -ENXIO;
 			goto abort;
+		}
 		dev_dbg(ndd->dev, "%s: allocated: %d\n", __func__, slot);
 
 		nd_label = nd_label_base(ndd) + slot;

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm