mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 03:50:24 +09:00
firmware: cs_dsp: Fix new control name check
[ Upstream commit7ac1102b22] Before adding a new FW control, its name is checked against existing controls list. But the string length in strncmp used to compare controls names is taken from the list, so if beginnings of the controls are matching, then the new control is not created. For example, if CAL_R control already exists, CAL_R_SELECTED is not created. The fix is to compare string lengths as well. Fixes:6477960755("ASoC: wm_adsp: Move check for control existence") Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230815172908.3454056-1-vkarpovi@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
711fb92606
commit
bc82cd1e7f
@@ -939,7 +939,8 @@ static int cs_dsp_create_control(struct cs_dsp *dsp,
|
||||
ctl->alg_region.alg == alg_region->alg &&
|
||||
ctl->alg_region.type == alg_region->type) {
|
||||
if ((!subname && !ctl->subname) ||
|
||||
(subname && !strncmp(ctl->subname, subname, ctl->subname_len))) {
|
||||
(subname && (ctl->subname_len == subname_len) &&
|
||||
!strncmp(ctl->subname, subname, ctl->subname_len))) {
|
||||
if (!ctl->enabled)
|
||||
ctl->enabled = 1;
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user