From: Peter Ujfalusi Date: Mon, 9 Feb 2026 12:02:39 +0000 (+0200) Subject: ASoC: SOF: ipc4-control: Set correct error code in refresh_bytes_control X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8f774913b4b599169381073f6674e20976e5529;p=thirdparty%2Fkernel%2Flinux.git 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 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 Link: https://patch.msgid.link/20260209120239.6066-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown --- 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; }