Commit e3e4964d authored by Mika Kuoppala's avatar Mika Kuoppala Committed by Rodrigo Vivi

drm/xe: destroy clients engine and vm xarrays on close

xe_file_close cleanups the xarrays but forgets
to destroy them causing a memleak in xarray internals.
Found with kmemleak.
Signed-off-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: default avatarChristoph Manszewski <christoph.manszewski@intel.com>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent a5cecbac
......@@ -69,6 +69,7 @@ static void xe_file_close(struct drm_device *dev, struct drm_file *file)
xe_engine_put(e);
}
mutex_unlock(&xef->engine.lock);
xa_destroy(&xef->engine.xa);
mutex_destroy(&xef->engine.lock);
device_kill_persistent_engines(xe, xef);
......@@ -76,6 +77,7 @@ static void xe_file_close(struct drm_device *dev, struct drm_file *file)
xa_for_each(&xef->vm.xa, idx, vm)
xe_vm_close_and_put(vm);
mutex_unlock(&xef->vm.lock);
xa_destroy(&xef->vm.xa);
mutex_destroy(&xef->vm.lock);
kfree(xef);
......
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