diff mbox series

ASoC: intel: skylake: Add check for dma_set_max_seg_size

Message ID 20240429042320.2150567-1-nichen@iscas.ac.cn
State New
Headers show
Series ASoC: intel: skylake: Add check for dma_set_max_seg_size | expand

Commit Message

Chen Ni April 29, 2024, 4:23 a.m. UTC
Add check for the return value of dma_set_max_seg_size() and return
the error if it fails in order to catch the error.

Fixes: c22a8086b384 ("ASoC: intel: skylake: Set max DMA segment size")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
 sound/soc/intel/skylake/skl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index 117125187793..8edc13795462 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -943,7 +943,9 @@  static int skl_first_init(struct hdac_bus *bus)
 	/* allow 64bit DMA address if supported by H/W */
 	if (dma_set_mask_and_coherent(bus->dev, DMA_BIT_MASK(64)))
 		dma_set_mask_and_coherent(bus->dev, DMA_BIT_MASK(32));
-	dma_set_max_seg_size(bus->dev, UINT_MAX);
+	err = dma_set_max_seg_size(bus->dev, UINT_MAX);
+	if (err)
+		return err;
 
 	/* initialize streams */
 	snd_hdac_ext_stream_init_all