summaryrefslogtreecommitdiff
path: root/arch/mips
diff options
context:
space:
mode:
authorThomas Bogendoerfer <tbogendoerfer@suse.de>2019-10-09 17:10:56 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-06 12:43:17 +0100
commit205cb89c17cb490ffbfe55c9e6ae1c6ee5366ea5 (patch)
treed864b1310feafd9838ab99cc2b9b1eac157b1205 /arch/mips
parentca1e2d0660a9f53a87b88738c43e64fd376eb026 (diff)
MIPS: fw: sni: Fix out of bounds init of o32 stack
[ Upstream commit efcb529694c3b707dc0471b312944337ba16e4dd ] 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 Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/fw/sni/sniprom.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/fw/sni/sniprom.c b/arch/mips/fw/sni/sniprom.c
index 6aa264b9856a..7c6151d412bd 100644
--- a/arch/mips/fw/sni/sniprom.c
+++ b/arch/mips/fw/sni/sniprom.c
@@ -42,7 +42,7 @@
/* O32 stack has to be 8-byte aligned. */
static u64 o32_stk[4096];
-#define O32_STK &o32_stk[sizeof(o32_stk)]
+#define O32_STK (&o32_stk[ARRAY_SIZE(o32_stk)])
#define __PROM_O32(fun, arg) fun arg __asm__(#fun); \
__asm__(#fun " = call_o32")