diff options
author | Thomas Bogendoerfer <tbogendoerfer@suse.de> | 2019-10-09 11:10:56 -0400 |
---|---|---|
committer | Paul Burton <paul.burton@mips.com> | 2019-10-09 15:47:28 -0400 |
commit | efcb529694c3b707dc0471b312944337ba16e4dd (patch) | |
tree | 72f72386b650978c472118d7b5df118c2f7786d1 /arch/mips | |
parent | 46f1619500d022501a4f0389f9f4c349ab46bb86 (diff) |
MIPS: fw: sni: Fix out of bounds init of o32 stack
Use ARRAY_SIZE to caluculate the top of the o32 stack.
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/fw/sni/sniprom.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/fw/sni/sniprom.c b/arch/mips/fw/sni/sniprom.c index 8772617b64ce..80112f2298b6 100644 --- a/arch/mips/fw/sni/sniprom.c +++ b/arch/mips/fw/sni/sniprom.c | |||
@@ -43,7 +43,7 @@ | |||
43 | 43 | ||
44 | /* O32 stack has to be 8-byte aligned. */ | 44 | /* O32 stack has to be 8-byte aligned. */ |
45 | static u64 o32_stk[4096]; | 45 | static u64 o32_stk[4096]; |
46 | #define O32_STK &o32_stk[sizeof(o32_stk)] | 46 | #define O32_STK (&o32_stk[ARRAY_SIZE(o32_stk)]) |
47 | 47 | ||
48 | #define __PROM_O32(fun, arg) fun arg __asm__(#fun); \ | 48 | #define __PROM_O32(fun, arg) fun arg __asm__(#fun); \ |
49 | __asm__(#fun " = call_o32") | 49 | __asm__(#fun " = call_o32") |