]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gvt: Refine dmabuf_obj cleanup process
authorTina Zhang <tina.zhang@intel.com>
Fri, 8 Dec 2017 07:17:38 +0000 (15:17 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Fri, 8 Dec 2017 08:20:12 +0000 (16:20 +0800)
commit6ee942d5f7e3e630d3a2517e75969ce5d07c87d6
tree4112861fabf8a3acbde1eb052c42022dd2c215bf
parent072ec93d50fd4c4b27ea44fff160a95c2b581eb1
drm/i915/gvt: Refine dmabuf_obj cleanup process

In the process of dmabuf_obj cleanup, the dmabuf_obj might be freed during
dmabuf_obj_put leaking intel_gvt_hypervisor_put_vfio_device.

Move intel_gvt_hypervisor_put_vfio_device and all the other dmabuf_obj ops
in front of dmabuf_obj_put and let every dmabuf_obj have a chance to call
intel_gvt_hypervisor_put_vfio_device to fix this leaking issue.

Fixes: e3a0d7976c53 ("drm/i915/gvt: Handle orphan dmabuf_objs")
Signed-off-by: Tina Zhang <tina.zhang@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/dmabuf.c