DRM: Armada: prime refcounting bug fix
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 7 Dec 2013 16:28:39 +0000 (16:28 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 10 Dec 2013 20:25:18 +0000 (20:25 +0000)
Commit 011c2282c74d changed the way refcounting on imported dma_bufs
works, and this hadn't been spotted while forward-porting Armada.
Reflect the changes in that commit into the Armada driver.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/gpu/drm/armada/armada_gem.c

index adc7c2da75bb6a1ea1badeda236d9ca8964435a7..887816f43476937fcfbceed5207025b63eccb132 100644 (file)
@@ -558,7 +558,6 @@ armada_gem_prime_import(struct drm_device *dev, struct dma_buf *buf)
                         * refcount on the gem object itself.
                         */
                        drm_gem_object_reference(obj);
-                       dma_buf_put(buf);
                        return obj;
                }
        }
@@ -574,6 +573,7 @@ armada_gem_prime_import(struct drm_device *dev, struct dma_buf *buf)
        }
 
        dobj->obj.import_attach = attach;
+       get_dma_buf(buf);
 
        /*
         * Don't call dma_buf_map_attachment() here - it maps the