diff options
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_dmabuf.c')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_dmabuf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c index ba0a3aa78547..ff7f2a886a34 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c | |||
@@ -235,7 +235,6 @@ struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device *drm_dev, | |||
235 | * refcount on gem itself instead of f_count of dmabuf. | 235 | * refcount on gem itself instead of f_count of dmabuf. |
236 | */ | 236 | */ |
237 | drm_gem_object_reference(obj); | 237 | drm_gem_object_reference(obj); |
238 | dma_buf_put(dma_buf); | ||
239 | return obj; | 238 | return obj; |
240 | } | 239 | } |
241 | } | 240 | } |
@@ -244,6 +243,7 @@ struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device *drm_dev, | |||
244 | if (IS_ERR(attach)) | 243 | if (IS_ERR(attach)) |
245 | return ERR_PTR(-EINVAL); | 244 | return ERR_PTR(-EINVAL); |
246 | 245 | ||
246 | get_dma_buf(dma_buf); | ||
247 | 247 | ||
248 | sgt = dma_buf_map_attachment(attach, DMA_BIDIRECTIONAL); | 248 | sgt = dma_buf_map_attachment(attach, DMA_BIDIRECTIONAL); |
249 | if (IS_ERR_OR_NULL(sgt)) { | 249 | if (IS_ERR_OR_NULL(sgt)) { |
@@ -298,6 +298,8 @@ err_unmap_attach: | |||
298 | dma_buf_unmap_attachment(attach, sgt, DMA_BIDIRECTIONAL); | 298 | dma_buf_unmap_attachment(attach, sgt, DMA_BIDIRECTIONAL); |
299 | err_buf_detach: | 299 | err_buf_detach: |
300 | dma_buf_detach(dma_buf, attach); | 300 | dma_buf_detach(dma_buf, attach); |
301 | dma_buf_put(dma_buf); | ||
302 | |||
301 | return ERR_PTR(ret); | 303 | return ERR_PTR(ret); |
302 | } | 304 | } |
303 | 305 | ||