Skip to content

Commit 27657a6

Browse files
kengitergregkh
authored andcommitted
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>
1 parent d1b8cba commit 27657a6

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

sound/soc/intel/atom/sst-mfld-platform-pcm.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,13 @@ static int sst_media_hw_params(struct snd_pcm_substream *substream,
399399
struct snd_pcm_hw_params *params,
400400
struct snd_soc_dai *dai)
401401
{
402-
snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
402+
int ret;
403+
404+
ret =
405+
snd_pcm_lib_malloc_pages(substream,
406+
params_buffer_bytes(params));
407+
if (ret)
408+
return ret;
403409
memset(substream->runtime->dma_area, 0, params_buffer_bytes(params));
404410
return 0;
405411
}

0 commit comments

Comments
 (0)