Skip to content

Commit fad88d4

Browse files
Zhang Qilonggregkh
authored andcommitted
libnvdimm/label: Return -ENXIO for no slot in __blk_label_update
[ Upstream commit 4c46764 ] Forget to set error code when nd_label_alloc_slot failed, and we add it to avoid overwritten error code. Fixes: 0ba1c63 ("libnvdimm: write blk label set") Signed-off-by: Zhang Qilong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent b6c6807 commit fad88d4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/nvdimm/label.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,8 +999,10 @@ static int __blk_label_update(struct nd_region *nd_region,
999999
if (is_old_resource(res, old_res_list, old_num_resources))
10001000
continue; /* carry-over */
10011001
slot = nd_label_alloc_slot(ndd);
1002-
if (slot == UINT_MAX)
1002+
if (slot == UINT_MAX) {
1003+
rc = -ENXIO;
10031004
goto abort;
1005+
}
10041006
dev_dbg(ndd->dev, "allocated: %d\n", slot);
10051007

10061008
nd_label = to_label(ndd, slot);

0 commit comments

Comments
 (0)