* [PATCH] dmaengine: axi-dmac: Add check for dma_set_max_seg_size
@ 2024-06-23 8:16 Ma Ke
2024-06-23 13:23 ` Markus Elfring
0 siblings, 1 reply; 2+ messages in thread
From: Ma Ke @ 2024-06-23 8:16 UTC (permalink / raw)
To: lars, vkoul; +Cc: dmaengine, linux-kernel, Ma Ke
To avoid possible failure of the dma_set_max_seg_size(), we should
better check the return value of the dma_set_max_seg_size().
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
---
drivers/dma/dma-axi-dmac.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c
index bdb752f11869..93543c2f1bd7 100644
--- a/drivers/dma/dma-axi-dmac.c
+++ b/drivers/dma/dma-axi-dmac.c
@@ -1051,7 +1051,9 @@ static int axi_dmac_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&dmac->chan.active_descs);
- dma_set_max_seg_size(&pdev->dev, UINT_MAX);
+ ret = dma_set_max_seg_size(&pdev->dev, UINT_MAX);
+ if (ret)
+ return ret;
dma_dev = &dmac->dma_dev;
dma_cap_set(DMA_SLAVE, dma_dev->cap_mask);
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-06-23 13:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-23 8:16 [PATCH] dmaengine: axi-dmac: Add check for dma_set_max_seg_size Ma Ke
2024-06-23 13:23 ` Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®