From: Dan Carpenter on
We need to add one to the strlen() return because of the NULL
character. The type->name here generally comes from the kernel and I
don't think any of them come close to being MAX_TRACER_SIZE (100)
characters long so this is basically a cleanup.

Signed-off-by: Dan Carpenter <error27(a)gmail.com>

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 086d363..5f13c35 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -729,7 +729,7 @@ __acquires(kernel_lock)
return -1;
}

- if (strlen(type->name) > MAX_TRACER_SIZE) {
+ if (strlen(type->name) >= MAX_TRACER_SIZE) {
pr_info("Tracer has a name longer than %d\n", MAX_TRACER_SIZE);
return -1;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/