From c53dae4ae8593eb5fc19e1120aed7b8443d18f40 Mon Sep 17 00:00:00 2001 From: ljf Date: Mon, 26 May 2014 15:28:11 +0800 Subject: [PATCH] rk3288: judge mmu status when deinitialize register structure --- arch/arm/mach-rockchip/vcodec_service.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-rockchip/vcodec_service.c b/arch/arm/mach-rockchip/vcodec_service.c index 14b1a5b15055..1d410e28d9ab 100755 --- a/arch/arm/mach-rockchip/vcodec_service.c +++ b/arch/arm/mach-rockchip/vcodec_service.c @@ -871,11 +871,13 @@ static void reg_deinit(struct vpu_service_info *pservice, vpu_reg *reg) #if defined(CONFIG_VCODEC_MMU) // release memory region attach to this registers table. - list_for_each_entry_safe(mem_region, n, ®->mem_region_list, reg_lnk) { - ion_unmap_iommu(pservice->dev, pservice->ion_client, mem_region->hdl); - ion_free(pservice->ion_client, mem_region->hdl); - list_del_init(&mem_region->reg_lnk); - kfree(mem_region); + if (pservice->mmu_dev) { + list_for_each_entry_safe(mem_region, n, ®->mem_region_list, reg_lnk) { + ion_unmap_iommu(pservice->dev, pservice->ion_client, mem_region->hdl); + ion_free(pservice->ion_client, mem_region->hdl); + list_del_init(&mem_region->reg_lnk); + kfree(mem_region); + } } #endif -- 2.34.1