Merge tag 'asoc-fix-v5.0-rc2' into asoc-5.1
[linux-2.6-block.git] / sound / soc / intel / atom / sst-mfld-platform-pcm.c
index aefa5ce4cb592e6dc24a003b2ae8058bb39aa87a..b0873fea23ab4e0a9c28e594b1675ba57d780296 100644 (file)
@@ -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;
 }