summaryrefslogtreecommitdiff
path: root/sound/soc/sof/imx
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>2021-09-28 13:35:16 +0300
committerMark Brown <broonie@kernel.org>2021-09-28 15:16:26 +0300
commit6a0ba071b71c44bc905522b77e96afad464e8aac (patch)
treed2e121ed7e65d72c6846cce61be8700bdae3bee2 /sound/soc/sof/imx
parentb05cfb1215223a750cff5367b625f0ed285a36cf (diff)
downloadlinux-6a0ba071b71c44bc905522b77e96afad464e8aac.tar.xz
ASoC: SOF: add error handling to snd_sof_ipc_msg_data()
If an invalid stream is passed to snd_sof_ipc_msg_data() it won't fill the provided object with data. The caller has to be able to recognise such cases to avoid handling invalid data. Make the function return an error when failing. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20210928103516.8066-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/imx')
-rw-r--r--sound/soc/sof/imx/imx8.c7
-rw-r--r--sound/soc/sof/imx/imx8m.c7
2 files changed, 8 insertions, 6 deletions
diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c
index c61c0e3a56a0..080dafbf5c33 100644
--- a/sound/soc/sof/imx/imx8.c
+++ b/sound/soc/sof/imx/imx8.c
@@ -369,11 +369,12 @@ static int imx8_get_bar_index(struct snd_sof_dev *sdev, u32 type)
return type;
}
-static void imx8_ipc_msg_data(struct snd_sof_dev *sdev,
- struct snd_pcm_substream *substream,
- void *p, size_t sz)
+static int imx8_ipc_msg_data(struct snd_sof_dev *sdev,
+ struct snd_pcm_substream *substream,
+ void *p, size_t sz)
{
sof_mailbox_read(sdev, sdev->dsp_box.offset, p, sz);
+ return 0;
}
static int imx8_ipc_pcm_params(struct snd_sof_dev *sdev,
diff --git a/sound/soc/sof/imx/imx8m.c b/sound/soc/sof/imx/imx8m.c
index 7983b1e5e3c2..7094790b8aba 100644
--- a/sound/soc/sof/imx/imx8m.c
+++ b/sound/soc/sof/imx/imx8m.c
@@ -232,11 +232,12 @@ static int imx8m_get_bar_index(struct snd_sof_dev *sdev, u32 type)
return type;
}
-static void imx8m_ipc_msg_data(struct snd_sof_dev *sdev,
- struct snd_pcm_substream *substream,
- void *p, size_t sz)
+static int imx8m_ipc_msg_data(struct snd_sof_dev *sdev,
+ struct snd_pcm_substream *substream,
+ void *p, size_t sz)
{
sof_mailbox_read(sdev, sdev->dsp_box.offset, p, sz);
+ return 0;
}
static int imx8m_ipc_pcm_params(struct snd_sof_dev *sdev,