Skip to content

Commit f8f7749

Browse files
ujfalusibroonie
authored andcommitted
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: 2a28b52 ("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>
1 parent 3a7dbc7 commit f8f7749

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

sound/soc/sof/ipc4-control.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ sof_ipc4_refresh_bytes_control(struct snd_sof_control *scontrol, bool lock)
362362
"%s: no space for data in %s (%zu, %zu)\n",
363363
__func__, scontrol->name, msg->data_size,
364364
scontrol->max_size - sizeof(*data));
365+
ret = -EINVAL;
365366
goto out;
366367
}
367368

0 commit comments

Comments
 (0)