diff options
author | Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> | 2021-09-28 13:35:16 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-09-28 15:16:26 +0300 |
commit | 6a0ba071b71c44bc905522b77e96afad464e8aac (patch) | |
tree | d2e121ed7e65d72c6846cce61be8700bdae3bee2 /sound/soc/sof/imx/imx8m.c | |
parent | b05cfb1215223a750cff5367b625f0ed285a36cf (diff) | |
download | linux-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/imx8m.c')
-rw-r--r-- | sound/soc/sof/imx/imx8m.c | 7 |
1 files changed, 4 insertions, 3 deletions
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, |