Skip to contentSkip to conversation

ASoC: SOF: ipc4-control: Return on error in sof_ipc4_widget_kcontrol_setup()

PATCH In review Peter Ujfalusi 3 participants 3 messages Mar 21, 2023 – Mar 23, 2023

Subsystems (3)
lore
Share & tools
lore

Peter Ujfalusi

author maintainer
#0 lore raw

PATCH v2 1/1 ASoC: SOF: ipc4-control: Return on error in sof_ipc4_widget_kcontrol_setup()

The patch adding the bytes control support moved the error check outside of the list_for_each_entry() which was not correct as at the end of the list_for_each_entry() the scontrol will no longer point where the error happened, but it to the list head.

Restore the original logic and return on the first error with the error code.

Fixes a062c8899fed ("ASoC: SOF: ipc4-control: Add support for bytes control get and put")
---
 sound/soc/sof/ipc4-control.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
sound/soc/sof/ipc4-control.c +8 -5
index d26ed2a6029f..6f0698be9451 100644
@@ -429,14 +429,17 @@ static int sof_ipc4_widget_kcontrol_setup(struct snd_sof_dev *sdev, struct snd_s
 			default:
 				break;
 			}
+
+			if (ret < 0) {
+				dev_err(sdev->dev,
+					"kcontrol %d set up failed for widget %s\n",
+					scontrol->comp_id, swidget->widget->name);
+				return ret;
+			}
 		}
 	}
 
-	if (ret < 0)
-		dev_err(sdev->dev, "kcontrol %d set up failed for widget %s\n",
-			scontrol->comp_id, swidget->widget->name);
-
-	return ret;
+	return 0;
 }
 
 static int
Signature · 1 line
2.40.0
#1 lore raw
Quoted 5 lines · Peter Ujfalusi

The patch adding the bytes control support moved the error check outside of the list_for_each_entry() which was not correct as at the end of the list_for_each_entry() the scontrol will no longer point where the error happened, but it to the list head.

Quoted 8 lines

Restore the original logic and return on the first error with the error code.

Fixes a062c8899fed ("ASoC: SOF: ipc4-control: Add support for bytes control get and put")

---

Awesome sauce! Thanks!

regards,
dan carpenter

maintainer
#2 lore raw
In reply to Peter Ujfalusi
Quoted 9 lines · Peter Ujfalusi

The patch adding the bytes control support moved the error check outside of the list_for_each_entry() which was not correct as at the end of the list_for_each_entry() the scontrol will no longer point where the error happened, but it to the list head.

Restore the original logic and return on the first error with the error code.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: SOF: ipc4-control: Return on error in sof_ipc4_widget_kcontrol_setup()

      commit: 1c12e032cc43256d75fdd22e60a7df85e8df4549

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