[PATCH] drm/i915/gvt: Free dmabuf_obj list in intel_vgpu_dmabuf_cleanup

Zhenyu Wang zhenyuw at linux.intel.com
Thu Nov 30 02:46:31 UTC 2017


On 2017.11.29 14:57:37 +0800, Tina Zhang wrote:
> 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.
> 
> Signed-off-by: Tina Zhang <tina.zhang at intel.com>
> ---

will pick this, but anyway good practice is to include Fixes: line
that can track and help script for required fixes, e.g

Fixes: e3a0d7976c53 ("drm/i915/gvt: Handle orphan dmabuf_objs")

>  drivers/gpu/drm/i915/gvt/dmabuf.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/dmabuf.c b/drivers/gpu/drm/i915/gvt/dmabuf.c
> index 5f39e90..9c40a67 100644
> --- a/drivers/gpu/drm/i915/gvt/dmabuf.c
> +++ b/drivers/gpu/drm/i915/gvt/dmabuf.c
> @@ -90,7 +90,7 @@ static void dmabuf_gem_object_free(struct kref *kref)
>  	struct list_head *pos;
>  	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) {
>  			dmabuf_obj = container_of(pos,
>  					struct intel_vgpu_dmabuf_obj, list);
> @@ -530,6 +530,7 @@ void intel_vgpu_dmabuf_cleanup(struct intel_vgpu *vgpu)
>  		if (dmabuf_obj->vgpu)
>  			intel_gvt_hypervisor_put_vfio_device(vgpu);
>  
> +		list_del(pos);
>  		dmabuf_obj->vgpu = NULL;
>  
>  	}
> -- 
> 2.7.4
> 

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20171130/c189ecb6/attachment.sig>


More information about the intel-gvt-dev mailing list