* [PATCH] dmaengine: stm32-dma: Fix static checker warning
@ 2015-11-24 8:52 M'boumba Cedric Madianga
2015-12-05 8:21 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: M'boumba Cedric Madianga @ 2015-11-24 8:52 UTC (permalink / raw)
To: linux-arm-kernel
This patch fix an unchecked dereference warning by returning operation
not permitted when stm32_dma_start_transfer() does not succeed to allocate
a virtual channel descriptor.
Signed-off-by: M'boumba Cedric Madianga <cedric.madianga@gmail.com>
---
drivers/dma/stm32-dma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c
index 12f3a3e..0214bcf 100644
--- a/drivers/dma/stm32-dma.c
+++ b/drivers/dma/stm32-dma.c
@@ -437,7 +437,7 @@ static int stm32_dma_start_transfer(struct stm32_dma_chan *chan)
if (!chan->desc) {
vdesc = vchan_next_desc(&chan->vchan);
if (!vdesc)
- return 0;
+ return -EPERM;
chan->desc = to_stm32_dma_desc(vdesc);
chan->next_sg = 0;
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] dmaengine: stm32-dma: Fix static checker warning
2015-11-24 8:52 [PATCH] dmaengine: stm32-dma: Fix static checker warning M'boumba Cedric Madianga
@ 2015-12-05 8:21 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2015-12-05 8:21 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 24, 2015 at 09:52:35AM +0100, M'boumba Cedric Madianga wrote:
Title should say what is fixes rather than what flagged it off
> This patch fix an unchecked dereference warning by returning operation
> not permitted when stm32_dma_start_transfer() does not succeed to allocate
> a virtual channel descriptor.
>
Also we give credit to reported by using tag Reported-by: xxx, pls add that
as well
> Signed-off-by: M'boumba Cedric Madianga <cedric.madianga@gmail.com>
> ---
> drivers/dma/stm32-dma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c
> index 12f3a3e..0214bcf 100644
> --- a/drivers/dma/stm32-dma.c
> +++ b/drivers/dma/stm32-dma.c
> @@ -437,7 +437,7 @@ static int stm32_dma_start_transfer(struct stm32_dma_chan *chan)
> if (!chan->desc) {
> vdesc = vchan_next_desc(&chan->vchan);
> if (!vdesc)
> - return 0;
> + return -EPERM;
>
> chan->desc = to_stm32_dma_desc(vdesc);
> chan->next_sg = 0;
> --
> 1.9.1
>
--
~Vinod
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-05 8:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-24 8:52 [PATCH] dmaengine: stm32-dma: Fix static checker warning M'boumba Cedric Madianga
2015-12-05 8:21 ` 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).