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

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
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);