diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-11-23 12:32:43 +0300 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-12-03 18:55:19 +0300 |
commit | 8d6185b55ceadea4fe3d7b451843786c4cae564e (patch) | |
tree | e83d5e767de97660f97a8215ed2a8bcc2405f31b /drivers/gpu/drm/armada | |
parent | 7a6f7133c573f237f2ed51652a947bc02aeeda4d (diff) | |
download | linux-8d6185b55ceadea4fe3d7b451843786c4cae564e.tar.xz |
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: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/gpu/drm/armada')
-rw-r--r-- | drivers/gpu/drm/armada/armada_gem.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c index aaf88641bfc5..2a3ef7938f30 100644 --- a/drivers/gpu/drm/armada/armada_gem.c +++ b/drivers/gpu/drm/armada/armada_gem.c @@ -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 */ if (obj->obj.import_attach) { ret = -EINVAL; - goto err_unlock; + goto err_unref; } 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, DRM_DEBUG_DRIVER("handle %#x offset %llx\n", handle, *offset); } + err_unref: drm_gem_object_unreference(&obj->obj); err_unlock: mutex_unlock(&dev->struct_mutex); |