]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ALSA: intel_hdmi: Check for error num after setting mask
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Fri, 7 Jan 2022 02:08:51 +0000 (10:08 +0800)
committerTakashi Iwai <tiwai@suse.de>
Fri, 7 Jan 2022 07:25:32 +0000 (08:25 +0100)
To maintain the consistency of the code, it should be better to add the
sanity check after calling dma_set_mask_and_coherent(), like
tegra_pcm_dma_allocate() in `sound/soc/tegra/tegra_pcm.c`.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20220107020851.3095591-1-jiasheng@iscas.ac.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/x86/intel_hdmi_audio.c

index 378826312abe684edebed70c668af571d8c8a151..1c94eaff1931b993f02ac73e08500767699e9b5f 100644 (file)
@@ -1750,7 +1750,9 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
        card_ctx->irq = irq;
 
        /* only 32bit addressable */
-       dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+       ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+       if (ret)
+               return ret;
 
        init_channel_allocations();