ASoC: SOF: ipc4-control: Return on error in sof_ipc4_widget_kcontrol_setup()
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Tue, 21 Mar 2023 14:56:51 +0000 (16:56 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 21 Mar 2023 16:31:10 +0000 (16:31 +0000)
commit1c12e032cc43256d75fdd22e60a7df85e8df4549
tree1ee5398adc84a3934d6ce891d1808f9b852d45ee
parent1d78e193b5ad4601b75e86a9dc1850132d9ce303
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")
Reported-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/alsa-devel/6be945d2-40cb-46fb-67ba-ed3a19cddfa4@linux.intel.com/T/#t
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230321145651.9118-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc4-control.c