Commit c613d250 authored by Rob Clark's avatar Rob Clark Committed by Zheng Zengkai
Browse files

ASoC: rt5682: Fix crash due to out of scope stack vars

stable inclusion
from stable-v5.10.85
commit 2f4764fe36925adc708a867a6e612c08fe54ea8b
bugzilla: 186032 https://gitee.com/openeuler/kernel/issues/I4QVI4

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2f4764fe36925adc708a867a6e612c08fe54ea8b



--------------------------------

commit 4999d703 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: edbd24ea ("ASoC: rt5682: Drop usage of __clk_get_name()")
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
Reviewed-by: default avatarStephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20211118010453.843286-1-robdclark@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 933e3326
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment