Commit 82a3b670 authored by Tina Zhang's avatar Tina Zhang Committed by Zhenyu Wang

drm/i915/gvt: Free dmabuf_obj list in intel_vgpu_dmabuf_cleanup

The per vGPU dmabuf_obj list should be released in intel_vgpu_dmabuf_
cleanup, which is invoked either in the process of closing a VM or in
the process of removing a vGPU.

Fixes: e3a0d7976c53 ("drm/i915/gvt: Handle orphan dmabuf_objs")
Signed-off-by: default avatarTina Zhang <tina.zhang@intel.com>
Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
parent 4a136d59
...@@ -90,7 +90,7 @@ static void dmabuf_gem_object_free(struct kref *kref) ...@@ -90,7 +90,7 @@ static void dmabuf_gem_object_free(struct kref *kref)
struct list_head *pos; struct list_head *pos;
struct intel_vgpu_dmabuf_obj *dmabuf_obj; struct intel_vgpu_dmabuf_obj *dmabuf_obj;
if (vgpu) { if (vgpu && vgpu->active && !list_empty(&vgpu->dmabuf_obj_list_head)) {
list_for_each(pos, &vgpu->dmabuf_obj_list_head) { list_for_each(pos, &vgpu->dmabuf_obj_list_head) {
dmabuf_obj = container_of(pos, dmabuf_obj = container_of(pos,
struct intel_vgpu_dmabuf_obj, list); struct intel_vgpu_dmabuf_obj, list);
...@@ -530,6 +530,7 @@ void intel_vgpu_dmabuf_cleanup(struct intel_vgpu *vgpu) ...@@ -530,6 +530,7 @@ void intel_vgpu_dmabuf_cleanup(struct intel_vgpu *vgpu)
if (dmabuf_obj->vgpu) if (dmabuf_obj->vgpu)
intel_gvt_hypervisor_put_vfio_device(vgpu); intel_gvt_hypervisor_put_vfio_device(vgpu);
list_del(pos);
dmabuf_obj->vgpu = NULL; dmabuf_obj->vgpu = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment