diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-11-14 06:34:00 -0500 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2017-09-04 15:04:32 -0400 |
commit | 03e1f04414b6e8ad9dd20081c3f8304e81f28f47 (patch) | |
tree | edef2902485798ccc674ccb47e7254cefa50190e | |
parent | b5a3a128b44219f0802a8b7895e09233853c8b43 (diff) |
alpha: silence a buffer overflow warning
We check that "member" is in bounds for the first line, but we also use
it on the next line without checking which is a mistake.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
-rw-r--r-- | arch/alpha/kernel/setup.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c index 491e6a604e82..249229ab4942 100644 --- a/arch/alpha/kernel/setup.c +++ b/arch/alpha/kernel/setup.c | |||
@@ -1094,8 +1094,9 @@ get_sysnames(unsigned long type, unsigned long variation, unsigned long cpu, | |||
1094 | default: /* default to variation "0" for now */ | 1094 | default: /* default to variation "0" for now */ |
1095 | break; | 1095 | break; |
1096 | case ST_DEC_EB164: | 1096 | case ST_DEC_EB164: |
1097 | if (member < ARRAY_SIZE(eb164_indices)) | 1097 | if (member >= ARRAY_SIZE(eb164_indices)) |
1098 | *variation_name = eb164_names[eb164_indices[member]]; | 1098 | break; |
1099 | *variation_name = eb164_names[eb164_indices[member]]; | ||
1099 | /* PC164 may show as EB164 variation, but with EV56 CPU, | 1100 | /* PC164 may show as EB164 variation, but with EV56 CPU, |
1100 | so, since no true EB164 had anything but EV5... */ | 1101 | so, since no true EB164 had anything but EV5... */ |
1101 | if (eb164_indices[member] == 0 && cpu == EV56_CPU) | 1102 | if (eb164_indices[member] == 0 && cpu == EV56_CPU) |