• Laurent Pinchart's avatar
    drm: omapdrm: Take GEM object reference when exporting dmabuf · c488dd20
    Laurent Pinchart authored
    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: 6ad11bc3 ("staging: drm/omap: dmabuf/prime support")
    Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
    c488dd20
omap_gem_dmabuf.c 5.58 KB