From e0e8081b88ff4db2b3618f8dba811cfa48606d05 Mon Sep 17 00:00:00 2001 From: Jiasheng Jiang Date: Fri, 7 Jan 2022 10:08:51 +0800 Subject: [PATCH] ALSA: intel_hdmi: Check for error num after setting mask 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 Link: https://lore.kernel.org/r/20220107020851.3095591-1-jiasheng@iscas.ac.cn Signed-off-by: Takashi Iwai --- sound/x86/intel_hdmi_audio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c index 378826312abe6..1c94eaff1931b 100644 --- a/sound/x86/intel_hdmi_audio.c +++ b/sound/x86/intel_hdmi_audio.c @@ -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(); -- 2.39.5