drm/rockchip: don't leak iommu mapping
authorJohn Keeping <john@metanate.com>
Tue, 5 Apr 2016 13:50:32 +0000 (14:50 +0100)
committerMark Yao <mark.yao@rock-chips.com>
Tue, 3 May 2016 06:11:22 +0000 (14:11 +0800)
commit69b007968e7519cf1e44920f4578054c9e0fbdc3
tree00bcee6f4c3a1737b9b4f45fef42344b40f41a62
parentaa1ac27f48de0ed94d5a104e15b5ab62b5deb236
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.

Signed-off-by: John Keeping <john@metanate.com>
drivers/gpu/drm/rockchip/rockchip_drm_drv.c