drm/i915/gvt: Dereference msi eventfd_ctx when it isn't used anymore
authorXiong Zhang <xiong.y.zhang@intel.com>
Fri, 13 Apr 2018 02:26:16 +0000 (10:26 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Mon, 16 Apr 2018 09:24:04 +0000 (17:24 +0800)
commitd54e79340ff8d65b6c63ac278158add2fe211fd0
tree1a8e8b30c8c880465cbbdf2ca013c11e5fcfdfbe
parent2f24636b4b12e4f1eca23e6e5dd86ba335fc8066
drm/i915/gvt: Dereference msi eventfd_ctx when it isn't used anymore

kvmgt get msi eventfd_ctx at qemu vfio set irq eventfd, then
msi eventfd_ctx should be put at some point.
The first point is kvmgt handle qemu vfio_disable_irqindex()
call which has DATA_NONE and ACTION_TRIGGER in flags.
If qemu doesn't call vfio_disable_irqindex(), the second point
is vgpu release function.

v2: Don't inject msi interrupt into guest if eventfd_ctx is dereferenced

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/kvmgt.c