Unverified Commit f8f77491 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown
Browse files

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: default avatarDan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-sound/aYXvFr-LVHVJSvS7@stanley.mountain/


Fixes: 2a28b524 ("ASoC: SOF: ipc4-control: Add support for generic bytes control")
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20260209120239.6066-1-peter.ujfalusi@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3a7dbc72
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
		}