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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Dec 2018 13:15:21 +0000 (14:15 +0100)
commit80eaec9b94bccbd752b41523e160b63a4711a7f2
tree20c3d02befb40de85fb04a6f60e90535036d0197
parent5cb9667104e8de4d0a7ae0a6e5647d7b9055cb94
ARM: 8816/1: dma-mapping: fix potential uninitialized return

[ Upstream commit c2a3831df6dc164af66d8d86cf356a90c021b86f ]

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: 1655cf8829d8 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm/mm/dma-mapping.c