]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 8816/1: dma-mapping: fix potential uninitialized return
authorNathan Jones <nathanj439@gmail.com>
Tue, 4 Dec 2018 09:05:32 +0000 (10:05 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Tue, 4 Dec 2018 22:38:34 +0000 (22:38 +0000)
commit2bda24c561b659544c71fd3d51726464c2679de6
treed3bbfe10057d1c9c0717a65ff53f815991ad67d5
parent11b7b27049c8242b72eb51d654bc825185f9b273
ARM: 8816/1: dma-mapping: fix potential uninitialized return

While trying to use the dma_mmap_*() interface, it was noticed that this
interface returns strange values when passed an incorrect length.

If neither of the if() statements fire then the return value is
uninitialized. In the worst case it returns 0 which means the caller
will think the function succeeded.

Fixes: 36a0c3be2e6c ("ARM: dma-mapping: Remove traces of NOMMU code")
Signed-off-by: Nathan Jones <nathanj439@gmail.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/mm/dma-mapping.c