summaryrefslogtreecommitdiff
path: root/sound/soc/sof/ipc.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>2022-03-30 23:19:19 +0300
committerMark Brown <broonie@kernel.org>2022-04-04 10:39:04 +0300
commit78935913573b7c0397b5e3d4512ee0f67b280d3b (patch)
tree2dbbd66104fb8ef969fac4c158ea517d3d7fb6dc /sound/soc/sof/ipc.c
parenta3e6b3691b35c6312cff32127ffc01e81d6e6d41 (diff)
downloadlinux-78935913573b7c0397b5e3d4512ee0f67b280d3b.tar.xz
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>
Diffstat (limited to 'sound/soc/sof/ipc.c')
-rw-r--r--sound/soc/sof/ipc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c
index af2efc1c8436..166d4906698b 100644
--- a/sound/soc/sof/ipc.c
+++ b/sound/soc/sof/ipc.c
@@ -373,8 +373,8 @@ int sof_ipc_tx_message_no_pm(struct snd_sof_ipc *ipc, u32 header,
{
int ret;
- if (msg_bytes > SOF_IPC_MSG_MAX_SIZE ||
- reply_bytes > SOF_IPC_MSG_MAX_SIZE)
+ if (msg_bytes > ipc->max_payload_size ||
+ reply_bytes > ipc->max_payload_size)
return -ENOBUFS;
/* Serialise IPC TX */