kcsan: test: don't put the expect array on the stack
authorMax Filippov <jcmvbkbc@gmail.com>
Fri, 23 Dec 2022 07:28:21 +0000 (23:28 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Feb 2023 07:34:29 +0000 (08:34 +0100)
commitd5cb15095a93722b7d7ebf968f9baeb10f8e6206
tree8b1ac671b0301bc5aceecc536d8111d25a1ac024
parentfd14d29bb698b45b2712932e90a0b2a40d09d347
kcsan: test: don't put the expect array on the stack

[ Upstream commit 5b24ac2dfd3eb3e36f794af3aa7f2828b19035bd ]

Size of the 'expect' array in the __report_matches is 1536 bytes, which
is exactly the default frame size warning limit of the xtensa
architecture.
As a result allmodconfig xtensa kernel builds with the gcc that does not
support the compiler plugins (which otherwise would push the said
warning limit to 2K) fail with the following message:

  kernel/kcsan/kcsan_test.c:257:1: error: the frame size of 1680 bytes
    is larger than 1536 bytes

Fix it by dynamically allocating the 'expect' array.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Marco Elver <elver@google.com>
Tested-by: Marco Elver <elver@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/kcsan/kcsan_test.c