diff options
author | Kangjie Lu <kjlu@umn.edu> | 2018-12-25 20:29:48 -0600 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2019-05-02 21:41:13 +0100 |
commit | 35a0151943e72a57e0ad9ee7c98f7a8f7cd29f4f (patch) | |
tree | 23c08b7c57751bc2c42fc89299bb3c8f92601508 /sound | |
parent | bf9acddc04762d7bf308a3c34bcb29c7d376044f (diff) |
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>
[bwh: Backported to 3.16: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/intel/sst-mfld-platform-pcm.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sound/soc/intel/sst-mfld-platform-pcm.c b/sound/soc/intel/sst-mfld-platform-pcm.c index 7c790f51d259..47a2c3f5fa45 100644 --- a/sound/soc/intel/sst-mfld-platform-pcm.c +++ b/sound/soc/intel/sst-mfld-platform-pcm.c @@ -383,7 +383,13 @@ static snd_pcm_uframes_t sst_platform_pcm_pointer static int sst_platform_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { - 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; |