* [PATCH] firmware: cs_dsp: Fix new control name check
@ 2023-08-04 16:52 Vlad Karpovich
2023-08-08 12:51 ` Charles Keepax
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Vlad Karpovich @ 2023-08-04 16:52 UTC (permalink / raw)
To: Simon Trimmer, Charles Keepax, Richard Fitzgerald
Cc: patches, linux-kernel, Vlad Karpovich
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: 6477960755fb ("ASoC: wm_adsp: Move check for control existence")
Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com>
---
drivers/firmware/cirrus/cs_dsp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/firmware/cirrus/cs_dsp.c b/drivers/firmware/cirrus/cs_dsp.c
index 81cc3d0f6eec..81c5f94b1be1 100644
--- a/drivers/firmware/cirrus/cs_dsp.c
+++ b/drivers/firmware/cirrus/cs_dsp.c
@@ -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;
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] firmware: cs_dsp: Fix new control name check
2023-08-04 16:52 [PATCH] firmware: cs_dsp: Fix new control name check Vlad Karpovich
@ 2023-08-08 12:51 ` Charles Keepax
2023-08-15 9:25 ` Richard Fitzgerald
2023-08-15 17:29 ` Vlad Karpovich
2 siblings, 0 replies; 5+ messages in thread
From: Charles Keepax @ 2023-08-08 12:51 UTC (permalink / raw)
To: Vlad Karpovich; +Cc: Simon Trimmer, Richard Fitzgerald, patches, linux-kernel
On Fri, Aug 04, 2023 at 11:52:12AM -0500, Vlad Karpovich wrote:
> 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: 6477960755fb ("ASoC: wm_adsp: Move check for control existence")
> Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com>
> ---
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] firmware: cs_dsp: Fix new control name check
2023-08-04 16:52 [PATCH] firmware: cs_dsp: Fix new control name check Vlad Karpovich
2023-08-08 12:51 ` Charles Keepax
@ 2023-08-15 9:25 ` Richard Fitzgerald
2023-08-15 17:29 ` Vlad Karpovich
2 siblings, 0 replies; 5+ messages in thread
From: Richard Fitzgerald @ 2023-08-15 9:25 UTC (permalink / raw)
To: Vlad Karpovich, Simon Trimmer, Charles Keepax; +Cc: patches, linux-kernel
On 4/8/23 17:52, Vlad Karpovich wrote:
> 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: 6477960755fb ("ASoC: wm_adsp: Move check for control existence")
> Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com>
> ---
You need to send this to Mark Brown.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] firmware: cs_dsp: Fix new control name check
2023-08-04 16:52 [PATCH] firmware: cs_dsp: Fix new control name check Vlad Karpovich
2023-08-08 12:51 ` Charles Keepax
2023-08-15 9:25 ` Richard Fitzgerald
@ 2023-08-15 17:29 ` Vlad Karpovich
2023-08-15 20:41 ` Mark Brown
2 siblings, 1 reply; 5+ messages in thread
From: Vlad Karpovich @ 2023-08-15 17:29 UTC (permalink / raw)
To: Mark Brown, Simon Trimmer, Charles Keepax, Richard Fitzgerald
Cc: patches, linux-kernel, Ricardo Rivera-Matos, Vlad Karpovich
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: 6477960755fb ("ASoC: wm_adsp: Move check for control existence")
Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com>
---
drivers/firmware/cirrus/cs_dsp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/firmware/cirrus/cs_dsp.c b/drivers/firmware/cirrus/cs_dsp.c
index 81cc3d0f6eec..81c5f94b1be1 100644
--- a/drivers/firmware/cirrus/cs_dsp.c
+++ b/drivers/firmware/cirrus/cs_dsp.c
@@ -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;
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] firmware: cs_dsp: Fix new control name check
2023-08-15 17:29 ` Vlad Karpovich
@ 2023-08-15 20:41 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2023-08-15 20:41 UTC (permalink / raw)
To: Simon Trimmer, Charles Keepax, Richard Fitzgerald, Vlad Karpovich
Cc: patches, linux-kernel, Ricardo Rivera-Matos
On Tue, 15 Aug 2023 12:29:08 -0500, Vlad Karpovich wrote:
> 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.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] firmware: cs_dsp: Fix new control name check
commit: 7ac1102b227b36550452b663fd39ab1c09378a95
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-08-15 20:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-04 16:52 [PATCH] firmware: cs_dsp: Fix new control name check Vlad Karpovich
2023-08-08 12:51 ` Charles Keepax
2023-08-15 9:25 ` Richard Fitzgerald
2023-08-15 17:29 ` Vlad Karpovich
2023-08-15 20:41 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®