drm/etnaviv: unlock on error in etnaviv_gem_get_iova()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 4 Jan 2016 13:10:24 +0000 (16:10 +0300)
committerLucas Stach <l.stach@pengutronix.de>
Wed, 6 Jan 2016 11:13:45 +0000 (12:13 +0100)
We have to drop a lock before returning -ENOMEM here.

Fixes: a8c21a5451d8 ('drm/etnaviv: add initial etnaviv DRM driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/gpu/drm/etnaviv/etnaviv_gem.c

index 8d6f859f82003c863fb08dc9897d8e064050846e..9f77c3b94cc696c4683d18da3e7848fb040874c6 100644 (file)
@@ -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;