summaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm
diff options
context:
space:
mode:
authorNicolas Iooss <nicolas.iooss_linux@m4x.org>2016-10-29 13:28:52 +0200
committerDan Williams <dan.j.williams@intel.com>2016-11-11 20:37:42 -0800
commit2d9a02744f5a2e8325fc0c3e5533593261cead0a (patch)
tree82353ac815c7fd2990b8a10143fa861ff764f0de /drivers/nvdimm
parent82bf1037f2cab2d6960a08ae08513f2c3c0b335a (diff)
downloadlinux-2d9a02744f5a2e8325fc0c3e5533593261cead0a.tar.bz2
nvdimm: use the right length of "pmem"
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 <nicolas.iooss_linux@m4x.org> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm')
-rw-r--r--drivers/nvdimm/label.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c
index fac7cabe8f56..dd615345699f 100644
--- a/drivers/nvdimm/label.c
+++ b/drivers/nvdimm/label.c
@@ -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);