ASoC: SOF: ipc: Use ipc->max_payload_size for message/reply size checking

Use the ipc->max_payload_size for validating that the message or reply
size can be supported.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220330201926.1330402-5-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Peter Ujfalusi 2022-03-30 13:19:19 -07:00 committed by Mark Brown
parent a3e6b3691b
commit 7893591357
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 2 additions and 2 deletions

View File

@ -373,8 +373,8 @@ int sof_ipc_tx_message_no_pm(struct snd_sof_ipc *ipc, u32 header,
{ {
int ret; int ret;
if (msg_bytes > SOF_IPC_MSG_MAX_SIZE || if (msg_bytes > ipc->max_payload_size ||
reply_bytes > SOF_IPC_MSG_MAX_SIZE) reply_bytes > ipc->max_payload_size)
return -ENOBUFS; return -ENOBUFS;
/* Serialise IPC TX */ /* Serialise IPC TX */