* [PATCH] dmaengine: pl330: Fix overflow when reporting residue in memcpy
@ 2015-06-15 8:25 Krzysztof Kozlowski
2015-07-07 3:58 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Kozlowski @ 2015-06-15 8:25 UTC (permalink / raw)
To: Dan Williams, Vinod Koul, dmaengine, linux-kernel
Cc: Marek Szyprowski, Krzysztof Kozlowski, stable
During memcpy operations the residue was always set to an u32 overflowed
value.
In pl330_tx_status() function number of currently transferred bytes was
subtracted from internal "bytes_requested" field. However this
"bytes_requested" was not initialized at start to length of memcpy
buffer so transferred bytes were subtracted from 0 causing overflow.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: <stable@vger.kernel.org>
Fixes: aee4d1fac887 ("dmaengine: pl330: improve pl330_tx_status() function")
---
drivers/dma/pl330.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index f513f77b1d85..c535cd059724 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2623,6 +2623,7 @@ pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst,
desc->rqcfg.brst_len = 1;
desc->rqcfg.brst_len = get_burst_len(desc, len);
+ desc->bytes_requested = len;
desc->txd.flags = flags;
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dmaengine: pl330: Fix overflow when reporting residue in memcpy
2015-06-15 8:25 [PATCH] dmaengine: pl330: Fix overflow when reporting residue in memcpy Krzysztof Kozlowski
@ 2015-07-07 3:58 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2015-07-07 3:58 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Dan Williams, dmaengine, linux-kernel, Marek Szyprowski, stable
On Mon, Jun 15, 2015 at 05:25:16PM +0900, Krzysztof Kozlowski wrote:
> During memcpy operations the residue was always set to an u32 overflowed
> value.
>
> In pl330_tx_status() function number of currently transferred bytes was
> subtracted from internal "bytes_requested" field. However this
> "bytes_requested" was not initialized at start to length of memcpy
> buffer so transferred bytes were subtracted from 0 causing overflow.
Applied, thanks
--
~Vinod
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-07-07 3:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-15 8:25 [PATCH] dmaengine: pl330: Fix overflow when reporting residue in memcpy Krzysztof Kozlowski
2015-07-07 3:58 ` 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).