mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] libnvdimm: fix error return code in __blk_label_update()
@ 2016-10-17 16:35 Wei Yongjun
  0 siblings, 0 replies; only message in thread
From: Wei Yongjun @ 2016-10-17 16:35 UTC (permalink / raw)
  To: Dan Williams; +Cc: Wei Yongjun, linux-nvdimm, linux-kernel

From: Wei Yongjun <weiyongjun1@huawei.com>

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

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/nvdimm/label.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c
index fac7cab..ab2927c 100644
--- a/drivers/nvdimm/label.c
+++ b/drivers/nvdimm/label.c
@@ -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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-10-17 16:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-17 16:35 [PATCH -next] libnvdimm: fix error return code in __blk_label_update() Wei Yongjun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®