Thread (3 messages) 3 messages, 3 authors, 2026-01-28
STALE168d

[PATCH] dmaengine: stm32-mdma: Add missing check for device_property_read_u32_array

From: Chen Ni <hidden>
Date: 2026-01-28 04:23:55
Also in: dmaengine, lkml
Subsystem: dma generic offload engine subsystem, stm32 dma drivers, the rest · Maintainers: Vinod Koul, Amélie Delaunay, Linus Torvalds

Add check for the return value of device_property_read_u32_array() and
return the error if it fails in order to catch the error.

Signed-off-by: Chen Ni <redacted>
---
 drivers/dma/stm32/stm32-mdma.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/dma/stm32/stm32-mdma.c b/drivers/dma/stm32/stm32-mdma.c
index b87d41b234df..f833724cf42c 100644
--- a/drivers/dma/stm32/stm32-mdma.c
+++ b/drivers/dma/stm32/stm32-mdma.c
@@ -1630,9 +1630,11 @@ static int stm32_mdma_probe(struct platform_device *pdev)
 
 	dmadev->nr_channels = nr_channels;
 	dmadev->nr_requests = nr_requests;
-	device_property_read_u32_array(&pdev->dev, "st,ahb-addr-masks",
-				       dmadev->ahb_addr_masks,
-				       count);
+	ret = device_property_read_u32_array(&pdev->dev, "st,ahb-addr-masks",
+					     dmadev->ahb_addr_masks,
+					     count);
+	if (ret)
+		return ret;
 
 	dmadev->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(dmadev->base))
-- 
2.25.1

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help