[PATCH v4.4-rc8 4/4] x86/microcode/intel: get_matching_model_microcode: Squelch frame size warning

From: tim . gardner
Date: Thu Jan 07 2016 - 10:00:50 EST


From: Tim Gardner <tim.gardner@xxxxxxxxxxxxx>

arch/x86/kernel/cpu/microcode/intel.c: In function 'get_matching_model_microcode.isra.3.constprop':
arch/x86/kernel/cpu/microcode/intel.c:348:1: warning: the frame size of 1080 bytes is larger than 1024 bytes [-Wframe-larger-than=]

gcc version 5.3.1 20160101 (Ubuntu 5.3.1-5ubuntu1)

Cc: Borislav Petkov <bp@xxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
Signed-off-by: Tim Gardner <tim.gardner@xxxxxxxxxxxxx>
---
arch/x86/kernel/cpu/microcode/intel.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index e019c11..03099ea 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -303,11 +303,16 @@ get_matching_model_microcode(int cpu, unsigned long start,
enum ucode_state state = UCODE_OK;
unsigned int mc_size;
struct microcode_header_intel *mc_header;
- struct microcode_intel *mc_saved_tmp[MAX_UCODE_COUNT];
+ struct microcode_intel **mc_saved_tmp;
unsigned int mc_saved_count = mc_saved_data->mc_saved_count;
int i;

- while (leftover && mc_saved_count < ARRAY_SIZE(mc_saved_tmp)) {
+ mc_saved_tmp = kcalloc(MAX_UCODE_COUNT, sizeof(*mc_saved_tmp),
+ GFP_KERNEL);
+ if (!mc_saved_tmp)
+ return UCODE_ERROR;
+
+ while (leftover && mc_saved_count < MAX_UCODE_COUNT) {

if (leftover < sizeof(mc_header))
break;
@@ -352,6 +357,7 @@ get_matching_model_microcode(int cpu, unsigned long start,

mc_saved_data->mc_saved_count = mc_saved_count;
out:
+ kfree(mc_saved_tmp);
return state;
}

--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/