diff options
author | Arnd Bergmann <arnd@arndb.de> | 2020-05-07 23:33:51 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-05-08 18:52:12 +0100 |
commit | a1304cba816e017d5acde322ee1c751e368dbe5a (patch) | |
tree | f6155782c6fd9dbcddc0dd5a00f099aa70acc567 /sound/soc/mediatek | |
parent | 2d6201ee1123325c089008570bd5ddea3c5b131a (diff) |
ASoC: cros_ec_codec: allocate shash_desc dynamically
The wov_hotword_model_put() function has multiple large variables on
its stack, the largest of which is the result of SHASH_DESC_ON_STACK().
In total, this exceeds the warning limit for 32-bit architectures:
sound/soc/codecs/cros_ec_codec.c:776:12: error: stack frame size of 1152 bytes in function 'wov_hotword_model_put' [-Werror,-Wframe-larger-than=]
The function already has a dynamic crypto_alloc_shash() allocation, so
using kmalloc() for the descriptor is correct as well and does not
introduce any additional failure scenarios. With this, the stack usage
of wov_hotword_model_put() gets reduced to 480 bytes in my test
configuration.
Fixes: b6bc07d4360d ("ASoC: cros_ec_codec: support WoV")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200507213405.1869430-1-arnd@arndb.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/mediatek')
0 files changed, 0 insertions, 0 deletions