MGS-5284 [#imx-1786] fix GPU panic with vm_mmap failure
authorXianzhong <xianzhong.li@nxp.com>
Mon, 28 Oct 2019 17:55:53 +0000 (01:55 +0800)
committerXianzhong <xianzhong.li@nxp.com>
Tue, 29 Oct 2019 15:31:55 +0000 (23:31 +0800)
commitbf4a45c5e62f500b0689cfd7312903444e932218
tree1df9d0fb3d5959aaf05a46e8ce8ca69031211e60
parent656fa3ea8c44635dbf991275118953ba65334ad8
MGS-5284 [#imx-1786] fix GPU panic with vm_mmap failure

When vm_mmap fail, code jump to OnError with error status and userLogical variable != 0.
Then _CMAFSLUnmapUser is called with a invalid virtual address (MdlMap->vmaAddr) and cause panic.

Check userLogical to avoid GPU kernel panic for error handling.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit 710bbfc815c1058d32ad2295d630efb238ef1beb)
drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c