]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commitea83f51556eb630ca803ad2b81973d938e9d332e
treec11697e5a049c90794f5441d6dd85ba58a394155
parent1ec7c3bd0a44aeb42330b857849f1b95e2ccb588
ARM: 8816/1: dma-mapping: fix potential uninitialized return

BugLink: https://bugs.launchpad.net/bugs/1837257
[ 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>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/arm/mm/dma-mapping.c