Commit 8d6185b5 authored by Daniel Vetter's avatar Daniel Vetter Committed by Russell King

drm/armada: plug leak in dumb_map_offset

We need to drop the gem bo reference if it's an imported one.
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 7a6f7133
...@@ -285,7 +285,7 @@ int armada_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, ...@@ -285,7 +285,7 @@ int armada_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
/* Don't allow imported objects to be mapped */ /* Don't allow imported objects to be mapped */
if (obj->obj.import_attach) { if (obj->obj.import_attach) {
ret = -EINVAL; ret = -EINVAL;
goto err_unlock; goto err_unref;
} }
ret = drm_gem_create_mmap_offset(&obj->obj); ret = drm_gem_create_mmap_offset(&obj->obj);
...@@ -294,6 +294,7 @@ int armada_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, ...@@ -294,6 +294,7 @@ int armada_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
DRM_DEBUG_DRIVER("handle %#x offset %llx\n", handle, *offset); DRM_DEBUG_DRIVER("handle %#x offset %llx\n", handle, *offset);
} }
err_unref:
drm_gem_object_unreference(&obj->obj); drm_gem_object_unreference(&obj->obj);
err_unlock: err_unlock:
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment