As the possible failure of the dma_set_max_seg_size(), we should better check the return value of the dma_set_max_seg_size(). Fixes: 17b3cf4233d7 ("dmaengine: hsu: set maximum allowed segment size for DMA") Signed-off-by: Ma Ke <make24@xxxxxxxxxxx> --- drivers/dma/hsu/hsu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/dma/hsu/hsu.c b/drivers/dma/hsu/hsu.c index af5a2e252c25..9d02277fa923 100644 --- a/drivers/dma/hsu/hsu.c +++ b/drivers/dma/hsu/hsu.c @@ -479,7 +479,9 @@ int hsu_dma_probe(struct hsu_dma_chip *chip) hsu->dma.dev = chip->dev; - dma_set_max_seg_size(hsu->dma.dev, HSU_CH_DxTSR_MASK); + ret = dma_set_max_seg_size(hsu->dma.dev, HSU_CH_DxTSR_MASK); + if (ret) + return ret; ret = dma_async_device_register(&hsu->dma); if (ret) -- 2.25.1