summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>2026-02-09 15:02:39 +0300
committerMark Brown <broonie@kernel.org>2026-02-09 15:27:28 +0300
commitf8f774913b4b599169381073f6674e20976e5529 (patch)
tree69a4ce79f66735442ce27d174ef10f9e1c98a335
parent3a7dbc729e42b95f1a82806a11128c1926ab26d8 (diff)
downloadlinux-f8f774913b4b599169381073f6674e20976e5529.tar.xz
ASoC: SOF: ipc4-control: Set correct error code in refresh_bytes_control
Return -EINVAL in case the scontrol contains more data than the amount of space available for it to store in sof_ipc4_refresh_bytes_control(). Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/linux-sound/aYXvFr-LVHVJSvS7@stanley.mountain/ Fixes: 2a28b5240f2b ("ASoC: SOF: ipc4-control: Add support for generic bytes control") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://patch.msgid.link/20260209120239.6066-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/sof/ipc4-control.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/soc/sof/ipc4-control.c b/sound/soc/sof/ipc4-control.c
index 0500b690f9a3..596c3d77a34e 100644
--- a/sound/soc/sof/ipc4-control.c
+++ b/sound/soc/sof/ipc4-control.c
@@ -362,6 +362,7 @@ sof_ipc4_refresh_bytes_control(struct snd_sof_control *scontrol, bool lock)
"%s: no space for data in %s (%zu, %zu)\n",
__func__, scontrol->name, msg->data_size,
scontrol->max_size - sizeof(*data));
+ ret = -EINVAL;
goto out;
}