From: Ma Ke <make24@iscas.ac.cn>
To: vkoul@kernel.org, make24@iscas.ac.cn, andriy.shevchenko@linux.intel.com
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] dmaengine: hsu: Add check for dma_set_max_seg_size in hsu_dma_probe()
Date: Wed, 26 Jun 2024 16:27:11 +0800 [thread overview]
Message-ID: <20240626082711.2826915-1-make24@iscas.ac.cn> (raw)
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@iscas.ac.cn>
---
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
next reply other threads:[~2024-06-26 8:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-26 8:27 Ma Ke [this message]
2024-06-26 15:26 ` [PATCH] dmaengine: hsu: Add check for dma_set_max_seg_size in hsu_dma_probe() Markus Elfring
2024-06-28 5:51 ` Christoph Hellwig
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=20240626082711.2826915-1-make24@iscas.ac.cn \
--to=make24@iscas.ac.cn \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dmaengine@vger.kernel.org \
--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