Skip to content

Commit

Permalink
nvdimm: use the right length of "pmem"
Browse files Browse the repository at this point in the history
In order to test that the name of a resource begins with "pmem", call
strncmp() with 4 as length instead of 3 to match the whole prefix.

Signed-off-by: Nicolas Iooss <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
  • Loading branch information
fishilico authored and djbw committed Nov 12, 2016
1 parent 82bf103 commit 2d9a027
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvdimm/label.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ int nd_pmem_namespace_label_update(struct nd_region *nd_region,
}

for_each_dpa_resource(ndd, res)
if (strncmp(res->name, "pmem", 3) == 0)
if (strncmp(res->name, "pmem", 4) == 0)
count++;
WARN_ON_ONCE(!count);

Expand Down

0 comments on commit 2d9a027

Please sign in to comment.