]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: PL08x: fix array overflow in dma_set_runtime_config()
authorRussell King - ARM Linux <linux@arm.linux.org.uk>
Mon, 3 Jan 2011 22:30:44 +0000 (22:30 +0000)
committerDan Williams <dan.j.williams@intel.com>
Wed, 5 Jan 2011 03:16:10 +0000 (19:16 -0800)
commitb0c2d4e8fbb275b2d65d8cb417be57a37f71fa15
tree582fa3a2b9a99d2f36394e29d02ac001d72d2ff6
parent932df99c279c1a6d207b34dc444e479a9e083a0e
ARM: PL08x: fix array overflow in dma_set_runtime_config()

If maxburst was passed in as zero, we would overflow the burst_sizes[]
array.  Fix this by checking for this condition, and defaulting to
single transfer 'bursts'.

Improve the readability of the loop using a for() loop rather than
a while() loop with the iterator initialized far from the loop.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dma/amba-pl08x.c