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

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: stable@vger.kernel.org
Fixes: a6538207 ("ASoC: SOF: ipc4-topology: Correct the allocation size for bytes controls")
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarLiam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: default avatarSeppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20260326075618.1603-1-peter.ujfalusi@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent c6eea4ff
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2950,7 +2950,7 @@ static int sof_ipc4_control_load_bytes(struct snd_sof_dev *sdev, struct snd_sof_
		return -EINVAL;
	}

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