]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/prime: Pass the right module owner through to dma_buf_export()
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 5 Oct 2016 12:21:43 +0000 (13:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Oct 2016 11:02:04 +0000 (05:02 -0600)
commitb09e49284c7aed77965430dff098703aaaf04573
tree45de73eab9b7b31fcd62449bdfa4399249c53cd0
parent17ec8f95eddc1d0ba2560ed25256e6ca417638c2
drm/prime: Pass the right module owner through to dma_buf_export()

commit 56a76c0123d6cb034975901c80fce2627338ef9e upstream.

dma_buf_export() adds a reference to the owning module to the dmabuf (to
prevent the driver from being unloaded whilst a third party still refers
to the dmabuf). However, drm_gem_prime_export() was passing its own
THIS_MODULE (i.e. drm.ko) rather than the driver. Extract the right
owner from the device->fops instead.

v2: Use C99 initializers to zero out unset elements of
dma_buf_export_info
v3: Extract the right module from dev->fops.

Testcase: igt/vgem_basic/unload
Reported-by: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Christian König <christian.koenig@amd.com>
Tested-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161005122145.1507-1-chris@chris-wilson.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/drm_prime.c
include/drm/drmP.h