arm: dma-mapping: fix off-by-one error in bitmap size check 82/42682/2
authorMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 1 Jul 2015 13:33:03 +0000 (15:33 +0200)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 1 Jul 2015 13:33:03 +0000 (15:33 +0200)
commitadde421ca55ea643ee740e4a2ca1908b74013a45
tree28b01c98a4936b3bbb60b7b4ce92f33767f4eeb9
parent2c6e222e3a5133a0c5792832cb85167b32d94bf7
arm: dma-mapping: fix off-by-one error in bitmap size check

nr_bitmaps member of mapping structure stores the number of already
allocated bitmaps and it is interpreted as loop iterator (it starts from
0 not from 1), so a comparison against number of possible bitmap
extensions should include this fact. This patch fixes this by changing
the extension failure condition.

Reported-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Id929785a802790c9ab8500a50cd2496ab69545eb
arch/arm/mm/dma-mapping.c