From: Chen Ni <nichen@iscas.ac.cn>
To: inki.dae@samsung.com, sw0312.kim@samsung.com,
kyungmin.park@samsung.com, airlied@gmail.com, daniel@ffwll.ch,
krzk@kernel.org, alim.akhtar@samsung.com,
m.szyprowski@samsung.com
Cc: dri-devel@lists.freedesktop.org,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
Chen Ni <nichen@iscas.ac.cn>
Subject: [PATCH] drm/exynos: Add check for dma_set_max_seg_size
Date: Mon, 29 Apr 2024 10:38:33 +0800 [thread overview]
Message-ID: <20240429023833.1869154-1-nichen@iscas.ac.cn> (raw)
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: ddfd4ab6bb08 ("drm/exynos: Fix dma_parms allocation")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
drivers/gpu/drm/exynos/exynos_drm_dma.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dma.c b/drivers/gpu/drm/exynos/exynos_drm_dma.c
index e2c7373f20c6..0f942186f3ff 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dma.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dma.c
@@ -51,7 +51,10 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev,
return -EINVAL;
}
- dma_set_max_seg_size(subdrv_dev, DMA_BIT_MASK(32));
+ ret = dma_set_max_seg_size(subdrv_dev, DMA_BIT_MASK(32));
+ if (ret)
+ return ret;
+
if (IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU)) {
/*
* Keep the original DMA mapping of the sub-device and
--
2.25.1
next reply other threads:[~2024-04-29 2:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-29 2:38 Chen Ni [this message]
2024-04-29 4:36 ` [PATCH] drm/exynos: Add check for dma_set_max_seg_size 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=20240429023833.1869154-1-nichen@iscas.ac.cn \
--to=nichen@iscas.ac.cn \
--cc=airlied@gmail.com \
--cc=alim.akhtar@samsung.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=inki.dae@samsung.com \
--cc=krzk@kernel.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=sw0312.kim@samsung.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).