Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2018-10-31 10:48:30 +0100
committerJohannes Thumshirn <jthumshirn@suse.de>2018-10-31 10:49:27 +0100
commitce990735629ed607c8cc4707dcc7e988d06ca39c (patch)
tree0a8a4fa0f3ce32c25402fce7a1662963916bbc2b
parent41a3bde94b19d111706c6c51ee6459845bb6c591 (diff)
libnvdimm, label: Fix sparse warning (bsc#1111921, bsc#1113408,
-rw-r--r--drivers/nvdimm/label.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c
index 9b443f50d289..7afc5eecd6f5 100644
--- a/drivers/nvdimm/label.c
+++ b/drivers/nvdimm/label.c
@@ -429,6 +429,7 @@ int nd_label_data_init(struct nvdimm_drvdata *ndd)
struct nd_namespace_index *nsindex;
unsigned int i;
int rc = 0;
+ u32 nslot;
if (ndd->data)
return 0;
@@ -500,9 +501,10 @@ int nd_label_data_init(struct nvdimm_drvdata *ndd)
/* Determine starting offset for label data */
offset = __le64_to_cpu(nsindex->labeloff);
+ nslot = __le32_to_cpu(nsindex->nslot);
/* Loop through the free list pulling in any active labels */
- for (i = 0; i < nsindex->nslot; i++, offset += ndd->nslabel_size) {
+ for (i = 0; i < nslot; i++, offset += ndd->nslabel_size) {
size_t label_read_size;
/* zero out the unused labels */