From: Nicolas Iooss Date: Sat, 29 Oct 2016 11:28:52 +0000 (+0200) Subject: nvdimm: use the right length of "pmem" X-Git-Tag: v4.10-rc1~48^2^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2d9a02744f5a2e8325fc0c3e5533593261cead0a;p=platform%2Fkernel%2Flinux-exynos.git 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 Signed-off-by: Dan Williams --- diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c index fac7cabe..dd61534 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);