Skip to content

Commit d40a198

Browse files
ujfalusibroonie
authored andcommitted
ASoC: SOF: ipc4-topology: Allow bytes controls without initial payload
It is unexpected, but allowed to have no initial payload for a bytes control and the code is prepared to handle this case, but the size check missed this corner case. Update the check for minimal size to allow the initial size to be 0. Cc: [email protected] Fixes: a653820 ("ASoC: SOF: ipc4-topology: Correct the allocation size for bytes controls") Signed-off-by: Peter Ujfalusi <[email protected]> Reviewed-by: Bard Liao <[email protected]> Reviewed-by: Liam Girdwood <[email protected]> Reviewed-by: Seppo Ingalsuo <[email protected]> Reviewed-by: Kai Vehmanen <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c6eea4f commit d40a198

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/soc/sof/ipc4-topology.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2950,7 +2950,7 @@ static int sof_ipc4_control_load_bytes(struct snd_sof_dev *sdev, struct snd_sof_
29502950
return -EINVAL;
29512951
}
29522952

2953-
if (scontrol->priv_size < sizeof(struct sof_abi_hdr)) {
2953+
if (scontrol->priv_size && scontrol->priv_size < sizeof(struct sof_abi_hdr)) {
29542954
dev_err(sdev->dev,
29552955
"bytes control %s initial data size %zu is insufficient.\n",
29562956
scontrol->name, scontrol->priv_size);

0 commit comments

Comments
 (0)