diff options
| author | Takashi Iwai <tiwai@suse.de> | 2010-12-13 09:29:52 +0100 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2010-12-13 09:29:52 +0100 |
| commit | 354d14b3f53cc749c5d26d4ba7280d1e931d6bc4 (patch) | |
| tree | 59b597e44902d8db8bde7deac1e7e707327c6fe6 /drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | |
| parent | 5144c534d16529bc469396211131e8935589f833 (diff) | |
| parent | 5b84ba26a9672e615897234fa5efd3eea2d6b295 (diff) | |
| download | olio-linux-3.10-354d14b3f53cc749c5d26d4ba7280d1e931d6bc4.tar.xz olio-linux-3.10-354d14b3f53cc749c5d26d4ba7280d1e931d6bc4.zip | |
Merge branch 'topic/workq-update' into topic/misc
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_resource.c')
| -rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c index 36e129f0023..5408b1b7996 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c @@ -862,7 +862,7 @@ int vmw_dmabuf_alloc_ioctl(struct drm_device *dev, void *data, &vmw_vram_sys_placement, true, &vmw_user_dmabuf_destroy); if (unlikely(ret != 0)) - return ret; + goto out_no_dmabuf; tmp = ttm_bo_reference(&vmw_user_bo->dma.base); ret = ttm_base_object_init(vmw_fpriv(file_priv)->tfile, @@ -870,19 +870,21 @@ int vmw_dmabuf_alloc_ioctl(struct drm_device *dev, void *data, false, ttm_buffer_type, &vmw_user_dmabuf_release, NULL); - if (unlikely(ret != 0)) { - ttm_bo_unref(&tmp); - } else { + if (unlikely(ret != 0)) + goto out_no_base_object; + else { rep->handle = vmw_user_bo->base.hash.key; rep->map_handle = vmw_user_bo->dma.base.addr_space_offset; rep->cur_gmr_id = vmw_user_bo->base.hash.key; rep->cur_gmr_offset = 0; } - ttm_bo_unref(&tmp); +out_no_base_object: + ttm_bo_unref(&tmp); +out_no_dmabuf: ttm_read_unlock(&vmaster->lock); - return 0; + return ret; } int vmw_dmabuf_unref_ioctl(struct drm_device *dev, void *data, |