drm/etnaviv: fix missing unlock on error in etnaviv_iommuv1_context_alloc()

Add the missing unlock before return from function etnaviv_iommuv1_context_alloc()
in the error handling case.

Fixes: 27b67278e0 ("drm/etnaviv: rework MMU handling")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
This commit is contained in:
Wei Yongjun 2019-08-19 06:17:33 +00:00 committed by Lucas Stach
parent 578d2342ec
commit dbcc574a4b
1 changed files with 3 additions and 1 deletions

View File

@ -140,8 +140,10 @@ etnaviv_iommuv1_context_alloc(struct etnaviv_iommu_global *global)
}
v1_context = kzalloc(sizeof(*v1_context), GFP_KERNEL);
if (!v1_context)
if (!v1_context) {
mutex_unlock(&global->lock);
return NULL;
}
v1_context->pgtable_cpu = dma_alloc_wc(global->dev, PT_SIZE,
&v1_context->pgtable_dma,