Commit 6db2983c authored by Eugene Loh's avatar Eugene Loh Committed by Masahiro Yamada

kallsyms: Handle too long symbols in kallsyms.c

When checking for symbols with excessively long names,
account for null terminating character.

Fixes: f3462aa9 ("Kbuild: Handle longer symbols in kallsyms.c")
Signed-off-by: default avatarEugene Loh <eugene.loh@oracle.com>
Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent f17b5f06
......@@ -118,8 +118,8 @@ static int read_symbol(FILE *in, struct sym_entry *s)
fprintf(stderr, "Read error or end of file.\n");
return -1;
}
if (strlen(sym) > KSYM_NAME_LEN) {
fprintf(stderr, "Symbol %s too long for kallsyms (%zu vs %d).\n"
if (strlen(sym) >= KSYM_NAME_LEN) {
fprintf(stderr, "Symbol %s too long for kallsyms (%zu >= %d).\n"
"Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n",
sym, strlen(sym), KSYM_NAME_LEN);
return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment