From: Ma Ke <make24@iscas.ac.cn>
To: lars@metafoo.de, vkoul@kernel.org
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
Ma Ke <make24@iscas.ac.cn>
Subject: [PATCH] dmaengine: axi-dmac: Add check for dma_set_max_seg_size
Date: Sun, 23 Jun 2024 16:16:44 +0800 [thread overview]
Message-ID: <20240623081644.2089695-1-make24@iscas.ac.cn> (raw)
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
next reply other threads:[~2024-06-23 8:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-23 8:16 Ma Ke [this message]
2024-06-23 13:23 ` Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240623081644.2089695-1-make24@iscas.ac.cn \
--to=make24@iscas.ac.cn \
--cc=dmaengine@vger.kernel.org \
--cc=lars@metafoo.de \
--cc=linux-kernel@vger.kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®