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.
Signed-off-by: Chen Ni <[email protected]>
---
drivers/dma/bcm2835-dma.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c
index 9d74fe97452e..d1e775a2f6b3 100644
--- a/drivers/dma/bcm2835-dma.c
+++ b/drivers/dma/bcm2835-dma.c
@@ -899,7 +899,11 @@ static int bcm2835_dma_probe(struct platform_device *pdev)
if (!od)
return -ENOMEM;
- dma_set_max_seg_size(&pdev->dev, 0x3FFFFFFF);
+ rc = dma_set_max_seg_size(&pdev->dev, 0x3FFFFFFF);
+ if (rc) {
+ dev_err(&pdev->dev, "Unable to set dma device segment size\n");
+ return rc;
+ }
base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base))
--
2.25.1
On Mon, Apr 29, 2024 at 12:13:12PM +0800, Chen Ni wrote:
> 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.
Ok. this looks like you're looking t all dma_set_max_seg_size callers?
If so mybe just work on removing the return value instead..