aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoqun Feng <[email protected]>2022-07-27 17:58:20 +0200
committerMiguel Ojeda <[email protected]>2022-09-28 08:54:17 +0200
commitb66c874fdb6653aefb3019aeaa9b9f8c1aadd6a0 (patch)
treebe669d54a0c7dfaf9ebe8fb64c0125603d705f84
parentf76349cf41451c5c42a99f18a9163377e4b364ff (diff)
kallsyms: use `ARRAY_SIZE` instead of hardcoded size
This removes one place where the `500` constant is hardcoded. Reviewed-by: Kees Cook <[email protected]> Reviewed-by: Geert Stappers <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Boqun Feng <[email protected]> Co-developed-by: Miguel Ojeda <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]>
-rw-r--r--scripts/kallsyms.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index f18e6dfc68c5..8551513f9311 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -206,7 +206,7 @@ static struct sym_entry *read_symbol(FILE *in)
rc = fscanf(in, "%llx %c %499s\n", &addr, &type, name);
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");
return NULL;
}