]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: SOF: ipc4-topology: Correct the allocation size for bytes controls
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Wed, 17 Dec 2025 14:39:39 +0000 (16:39 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 17 Dec 2025 16:35:45 +0000 (16:35 +0000)
commita653820700b81c9e6f05ac23b7969ecec1a18e85
treed547ddb0a4d2213ac754117f1d85694534b2f72d
parent2fa74713744dc5e908fff851c20f5f89fd665fb7
ASoC: SOF: ipc4-topology: Correct the allocation size for bytes controls

The size of the data behind of scontrol->ipc_control_data for bytes
controls is:
[1] sizeof(struct sof_ipc4_control_data) + // kernel only struct
[2] sizeof(struct sof_abi_hdr)) + payload

The max_size specifies the size of [2] and it is coming from topology.

Change the function to take this into account and allocate adequate amount
of memory behind scontrol->ipc_control_data.

With the change we will allocate [1] amount more memory to be able to hold
the full size of data.

Fixes: a382082ff74b ("ASoC: SOF: ipc4-topology: Add support for TPLG_CTL_BYTES")
Cc: stable@vger.kernel.org
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20251217143945.2667-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc4-topology.c