summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorKangjie Lu <kjlu@umn.edu>2018-12-25 20:29:48 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-31 08:14:34 +0100
commitd6847f539bd6ac2f8b75f0a6ae65c0955985d003 (patch)
tree71a5fef97145145d9fe406d3294eec9349e650cb /sound
parent3e05ceedf1439eea0a1306e30935ef5ee65e5d4f (diff)
downloadtalos-obmc-linux-d6847f539bd6ac2f8b75f0a6ae65c0955985d003.tar.gz
talos-obmc-linux-d6847f539bd6ac2f8b75f0a6ae65c0955985d003.zip
ASoC: atom: fix a missing check of snd_pcm_lib_malloc_pages
commit 44fabd8cdaaa3acb80ad2bb3b5c61ae2136af661 upstream. snd_pcm_lib_malloc_pages() may fail, so let's check its status and return its error code upstream. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/intel/atom/sst-mfld-platform-pcm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
index 6c36da560877..e662400873ec 100644
--- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c
+++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
@@ -399,7 +399,13 @@ static int sst_media_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{
- snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
+ int ret;
+
+ ret =
+ snd_pcm_lib_malloc_pages(substream,
+ params_buffer_bytes(params));
+ if (ret)
+ return ret;
memset(substream->runtime->dma_area, 0, params_buffer_bytes(params));
return 0;
}
OpenPOWER on IntegriCloud