Commit b66c874f authored by Boqun Feng's avatar Boqun Feng Committed by Miguel Ojeda

kallsyms: use `ARRAY_SIZE` instead of hardcoded size

This removes one place where the `500` constant is hardcoded.
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarGeert Stappers <stappers@stappers.nl>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarBoqun Feng <boqun.feng@gmail.com>
Co-developed-by: default avatarMiguel Ojeda <ojeda@kernel.org>
Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent f76349cf
...@@ -206,7 +206,7 @@ static struct sym_entry *read_symbol(FILE *in) ...@@ -206,7 +206,7 @@ static struct sym_entry *read_symbol(FILE *in)
rc = fscanf(in, "%llx %c %499s\n", &addr, &type, name); rc = fscanf(in, "%llx %c %499s\n", &addr, &type, name);
if (rc != 3) { if (rc != 3) {
if (rc != EOF && fgets(name, 500, in) == NULL) if (rc != EOF && fgets(name, ARRAY_SIZE(name), in) == NULL)
fprintf(stderr, "Read error or end of file.\n"); fprintf(stderr, "Read error or end of file.\n");
return NULL; return NULL;
} }
......
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