UPSTREAM: drm/rockchip: don't leak iommu mapping
authorJohn Keeping <john@metanate.com>
Tue, 5 Apr 2016 13:50:32 +0000 (14:50 +0100)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 7 Dec 2016 06:21:42 +0000 (14:21 +0800)
commite680ec3a1348e6cefddd1db6ba257725772b90a4
tree62b9d48e0e89f750e05f02139896718c79ff12aa
parent2097aa410e0d8541cee7ce0b28bb9ac681722e10
UPSTREAM: drm/rockchip: don't leak iommu mapping

arm_iommu_attach_device() takes its own reference to the mapping we give
it.  Since we do not keep a reference to the mapping ourselves, we must
release it before returning.

Also fix the error path, which fails to release the mapping if it has
called arm_iommu_detach_device() since that clears archdata.mapping.

Conflicts:
drivers/gpu/drm/rockchip/rockchip_drm_drv.c

Change-Id: Ia20334afbce08ece5a3238a7b0786547ec0cafb2
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Randy Li <randy.li@rock-chips.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 69b007968e7519cf1e44920f4578054c9e0fbdc3)
drivers/gpu/drm/rockchip/rockchip_drm_drv.c