]> git.baikalelectronics.ru Git - kernel.git/commit
drm: omapdrm: Take GEM object reference when exporting dmabuf
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 8 May 2017 18:59:24 +0000 (21:59 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 2 Jun 2017 07:57:08 +0000 (10:57 +0300)
commit6f69104b9d88189670a960d8531a07ac99ca30c3
tree30ba3a66adb5ce303f922700bc0ef01122d7a982
parentaa93004a47d3316cbcf4cda56f531d6fe0c1b98e
drm: omapdrm: Take GEM object reference when exporting dmabuf

To ensure that neither the GEM object nor the DRM device goes away while
a GEM object exported through dma-buf is still accessible, references
must be taken to both the GEM object and the DRM device at export time.
The dma-buf release handler already releases the GEM object, but the
export handler doesn't take a corresponding reference, which results in
a refcount underflow.

Fix this by replacing the custom implementation by
drm_gem_dmabuf_export() and drm_gem_dmabuf_release() that handle
reference counting for us.

Fixes: a2b292ec41fe ("staging: drm/omap: dmabuf/prime support")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c