dmaengine: stm32-mdma: Add a check on read_u32_array
authorAditya Pakki <pakki001@umn.edu>
Fri, 28 Dec 2018 19:26:41 +0000 (13:26 -0600)
committerVinod Koul <vkoul@kernel.org>
Mon, 7 Jan 2019 04:22:24 +0000 (09:52 +0530)
In stm32_mdma_probe, after reading the property "st,ahb-addr-masks", the
second call is not checked for failure. This time of check to time of use
case of "count" error is sent upstream.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Acked-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/stm32-mdma.c

index 390e4ca..485dea1 100644 (file)
@@ -1579,9 +1579,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",
+       ret = device_property_read_u32_array(&pdev->dev, "st,ahb-addr-masks",
                                       dmadev->ahb_addr_masks,
                                       count);
+       if (ret)
+               return ret;
        dmadev->nr_ahb_addr_masks = count;
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);