ASoC: rt5682: Fix crash due to out of scope stack vars
authorRob Clark <robdclark@chromium.org>
Thu, 18 Nov 2021 01:04:52 +0000 (17:04 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Dec 2021 09:57:16 +0000 (10:57 +0100)
commitcdb5a0d0e0075f9ede20f1aebd0b3f92ec743db4
treec0113bd7f7435989a42e808d6e8fa0bf4b6463ca
parente9362a21147afbfa9274a6888605388c6b06006b
ASoC: rt5682: Fix crash due to out of scope stack vars

commit 4999d703c0e66f9f196b6edc0b8fdeca8846b8b6 upstream.

Move the declaration of temporary arrays to somewhere that won't go out
of scope before the devm_clk_hw_register() call, lest we be at the whim
of the compiler for whether those stack variables get overwritten.

Fixes a crash seen with gcc version 11.2.1 20210728 (Red Hat 11.2.1-1)

Fixes: edbd24ea1e5c ("ASoC: rt5682: Drop usage of __clk_get_name()")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20211118010453.843286-1-robdclark@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/codecs/rt5682.c