* [PATCH] dmaengine: stm32-mdma: Add a check on read_u32_array
@ 2018-12-28 19:26 Aditya Pakki
2019-01-04 8:05 ` Pierre Yves MORDRET
2019-01-04 14:33 ` Vinod Koul
0 siblings, 2 replies; 3+ messages in thread
From: Aditya Pakki @ 2018-12-28 19:26 UTC (permalink / raw)
To: pakki001
Cc: kjlu, Dan Williams, Vinod Koul, Maxime Coquelin,
Alexandre Torgue, dmaengine, linux-stm32, linux-arm-kernel,
linux-kernel
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>
---
drivers/dma/stm32-mdma.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c
index 390e4cae0e1a..485dea177704 100644
--- a/drivers/dma/stm32-mdma.c
+++ b/drivers/dma/stm32-mdma.c
@@ -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);
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] dmaengine: stm32-mdma: Add a check on read_u32_array
2018-12-28 19:26 [PATCH] dmaengine: stm32-mdma: Add a check on read_u32_array Aditya Pakki
@ 2019-01-04 8:05 ` Pierre Yves MORDRET
2019-01-04 14:33 ` Vinod Koul
1 sibling, 0 replies; 3+ messages in thread
From: Pierre Yves MORDRET @ 2019-01-04 8:05 UTC (permalink / raw)
To: Aditya Pakki
Cc: Alexandre Torgue, kjlu, linux-kernel, Vinod Koul,
Maxime Coquelin, dmaengine, Dan Williams, linux-stm32,
linux-arm-kernel
Hello
Acked-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
Regards
On 12/28/18 8:26 PM, Aditya Pakki wrote:
> 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>
> ---
> drivers/dma/stm32-mdma.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c
> index 390e4cae0e1a..485dea177704 100644
> --- a/drivers/dma/stm32-mdma.c
> +++ b/drivers/dma/stm32-mdma.c
> @@ -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);
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dmaengine: stm32-mdma: Add a check on read_u32_array
2018-12-28 19:26 [PATCH] dmaengine: stm32-mdma: Add a check on read_u32_array Aditya Pakki
2019-01-04 8:05 ` Pierre Yves MORDRET
@ 2019-01-04 14:33 ` Vinod Koul
1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2019-01-04 14:33 UTC (permalink / raw)
To: Aditya Pakki
Cc: kjlu, Dan Williams, Maxime Coquelin, Alexandre Torgue, dmaengine,
linux-stm32, linux-arm-kernel, linux-kernel
On 28-12-18, 13:26, Aditya Pakki wrote:
> 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.
Applied, thanks
--
~Vinod
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-04 14:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-28 19:26 [PATCH] dmaengine: stm32-mdma: Add a check on read_u32_array Aditya Pakki
2019-01-04 8:05 ` Pierre Yves MORDRET
2019-01-04 14:33 ` Vinod Koul
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 NNTP newsgroup(s).