* [PATCH] dmaengine: k3dma: fix off by one
@ 2016-09-21 20:16 Vincent Stehlé
2016-09-22 1:32 ` zhangfei
2016-09-30 18:01 ` Vinod Koul
0 siblings, 2 replies; 4+ messages in thread
From: Vincent Stehlé @ 2016-09-21 20:16 UTC (permalink / raw)
To: dmaengine
Cc: linux-kernel, Vincent Stehlé, Zhangfei Gao, Vinod Koul, stable
In k3_of_dma_simple_xlate(), the d->chans[] array has d->dma_requests
elements so > should be >=.
Fixes: 8e6152bc660e69f5 ("dmaengine: Add hisilicon k3 DMA engine driver")
Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
Cc: Zhangfei Gao <zhangfei.gao@linaro.org>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: stable@vger.kernel.org
---
drivers/dma/k3dma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
index aabcb79..cd7f67b 100644
--- a/drivers/dma/k3dma.c
+++ b/drivers/dma/k3dma.c
@@ -792,7 +792,7 @@ static struct dma_chan *k3_of_dma_simple_xlate(struct of_phandle_args *dma_spec,
struct k3_dma_dev *d = ofdma->of_dma_data;
unsigned int request = dma_spec->args[0];
- if (request > d->dma_requests)
+ if (request >= d->dma_requests)
return NULL;
return dma_get_slave_channel(&(d->chans[request].vc.chan));
--
2.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] dmaengine: k3dma: fix off by one
2016-09-21 20:16 [PATCH] dmaengine: k3dma: fix off by one Vincent Stehlé
@ 2016-09-22 1:32 ` zhangfei
2016-09-30 18:01 ` Vinod Koul
1 sibling, 0 replies; 4+ messages in thread
From: zhangfei @ 2016-09-22 1:32 UTC (permalink / raw)
To: Vincent Stehlé, dmaengine; +Cc: linux-kernel, Vinod Koul, stable
On 2016年09月22日 04:16, Vincent Stehlé wrote:
> In k3_of_dma_simple_xlate(), the d->chans[] array has d->dma_requests
> elements so > should be >=.
>
> Fixes: 8e6152bc660e69f5 ("dmaengine: Add hisilicon k3 DMA engine driver")
> Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
> Cc: Zhangfei Gao <zhangfei.gao@linaro.org>
> Cc: Vinod Koul <vinod.koul@intel.com>
> Cc: stable@vger.kernel.org
Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dmaengine: k3dma: fix off by one
2016-09-21 20:16 [PATCH] dmaengine: k3dma: fix off by one Vincent Stehlé
@ 2016-09-30 18:01 ` Vinod Koul
2016-09-30 18:01 ` Vinod Koul
1 sibling, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2016-09-30 18:01 UTC (permalink / raw)
To: Vincent Stehlé; +Cc: dmaengine, linux-kernel, Zhangfei Gao, stable
On Wed, Sep 21, 2016 at 10:16:55PM +0200, Vincent Stehlé wrote:
> In k3_of_dma_simple_xlate(), the d->chans[] array has d->dma_requests
> elements so > should be >=.
>
> Fixes: 8e6152bc660e69f5 ("dmaengine: Add hisilicon k3 DMA engine driver")
> Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
> Cc: Zhangfei Gao <zhangfei.gao@linaro.org>
> Cc: Vinod Koul <vinod.koul@intel.com>
> Cc: stable@vger.kernel.org
Is it really stable material? Yes it fixes a bug, but how many will notice
this?
> ---
> drivers/dma/k3dma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
> index aabcb79..cd7f67b 100644
> --- a/drivers/dma/k3dma.c
> +++ b/drivers/dma/k3dma.c
> @@ -792,7 +792,7 @@ static struct dma_chan *k3_of_dma_simple_xlate(struct of_phandle_args *dma_spec,
> struct k3_dma_dev *d = ofdma->of_dma_data;
> unsigned int request = dma_spec->args[0];
>
> - if (request > d->dma_requests)
> + if (request >= d->dma_requests)
> return NULL;
>
> return dma_get_slave_channel(&(d->chans[request].vc.chan));
> --
> 2.9.3
>
--
~Vinod
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dmaengine: k3dma: fix off by one
@ 2016-09-30 18:01 ` Vinod Koul
0 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2016-09-30 18:01 UTC (permalink / raw)
To: Vincent Stehlé; +Cc: dmaengine, linux-kernel, Zhangfei Gao, stable
On Wed, Sep 21, 2016 at 10:16:55PM +0200, Vincent Stehl� wrote:
> In k3_of_dma_simple_xlate(), the d->chans[] array has d->dma_requests
> elements so > should be >=.
>
> Fixes: 8e6152bc660e69f5 ("dmaengine: Add hisilicon k3 DMA engine driver")
> Signed-off-by: Vincent Stehl� <vincent.stehle@laposte.net>
> Cc: Zhangfei Gao <zhangfei.gao@linaro.org>
> Cc: Vinod Koul <vinod.koul@intel.com>
> Cc: stable@vger.kernel.org
Is it really stable material? Yes it fixes a bug, but how many will notice
this?
> ---
> drivers/dma/k3dma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
> index aabcb79..cd7f67b 100644
> --- a/drivers/dma/k3dma.c
> +++ b/drivers/dma/k3dma.c
> @@ -792,7 +792,7 @@ static struct dma_chan *k3_of_dma_simple_xlate(struct of_phandle_args *dma_spec,
> struct k3_dma_dev *d = ofdma->of_dma_data;
> unsigned int request = dma_spec->args[0];
>
> - if (request > d->dma_requests)
> + if (request >= d->dma_requests)
> return NULL;
>
> return dma_get_slave_channel(&(d->chans[request].vc.chan));
> --
> 2.9.3
>
--
~Vinod
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-09-30 17:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-21 20:16 [PATCH] dmaengine: k3dma: fix off by one Vincent Stehlé
2016-09-22 1:32 ` zhangfei
2016-09-30 18:01 ` Vinod Koul
2016-09-30 18:01 ` Vinod Koul
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.