From: Dan Carpenter Date: Mon, 4 Jan 2016 13:10:24 +0000 (+0300) Subject: drm/etnaviv: unlock on error in etnaviv_gem_get_iova() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ed94add00e290e675c36cef6767d7d1f51a02f28;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/etnaviv: unlock on error in etnaviv_gem_get_iova() We have to drop a lock before returning -ENOMEM here. Fixes: a8c21a5451d8 ('drm/etnaviv: add initial etnaviv DRM driver') Signed-off-by: Dan Carpenter Acked-by: Russell King --- diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c index 8d6f859f8200..9f77c3b94cc6 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c @@ -305,8 +305,10 @@ int etnaviv_gem_get_iova(struct etnaviv_gpu *gpu, mapping = etnaviv_gem_get_vram_mapping(etnaviv_obj, NULL); if (!mapping) { mapping = kzalloc(sizeof(*mapping), GFP_KERNEL); - if (!mapping) - return -ENOMEM; + if (!mapping) { + ret = -ENOMEM; + goto out; + } INIT_LIST_HEAD(&mapping->scan_node); mapping->object = etnaviv_obj;