drm: prime: fix refcounting on the dmabuf import error path
authorImre Deak <imre.deak@intel.com>
Fri, 19 Apr 2013 01:11:56 +0000 (11:11 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 30 Apr 2013 23:40:21 +0000 (09:40 +1000)
In commit be8a42ae60 we inroduced a refcount problem, where on the
drm_gem_prime_fd_to_handle() error path we'll call dma_buf_put() for
self imported dma buffers.

Fix this by taking a reference on the dma buffer in the .gem_import
hook instead of assuming the caller had taken one. Besides fixing the
bug this is also more logical.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Cc: stable@vger.kernel.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>

No differences found