diff options
author | Thomas Hellström <thomas.hellstrom@linux.intel.com> | 2022-01-19 18:47:34 +0100 |
---|---|---|
committer | Thomas Hellström <thomas.hellstrom@linux.intel.com> | 2022-01-26 14:02:31 +0100 |
commit | 8f4f9a3b3a0b733f8fd102f9e0843cad8d055c83 (patch) | |
tree | 478e3f9e137f0c1f8752141549d4fcecceacb75e /drivers/gpu/drm/i915/i915_vma.c | |
parent | cec49bce6e0cdf916433a248402bfdecbf6589b0 (diff) |
drm/i915: Fix vma resource freeing
In some cases we use leftover kfree() instead of i915_vma_resource_free().
Fix this.
Fixes: 2f6b90da9192 ("drm/i915: Use vma resources for async unbinding")
Reported-by: Robert Beckett <bob.beckett@collabora.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220119174734.213552-1-thomas.hellstrom@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_vma.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_vma.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c index 426ed08b15ad..cdf1f9066c4f 100644 --- a/drivers/gpu/drm/i915/i915_vma.c +++ b/drivers/gpu/drm/i915/i915_vma.c @@ -463,7 +463,7 @@ int i915_vma_bind(struct i915_vma *vma, if (vma->resource || !vma_res) { /* Rebinding with an additional I915_VMA_*_BIND */ GEM_WARN_ON(!vma_flags); - kfree(vma_res); + i915_vma_resource_free(vma_res); } else { i915_vma_resource_init_from_vma(vma_res, vma); vma->resource = vma_res; @@ -1406,7 +1406,7 @@ err_active: err_unlock: mutex_unlock(&vma->vm->mutex); err_vma_res: - kfree(vma_res); + i915_vma_resource_free(vma_res); err_fence: if (work) dma_fence_work_commit_imm(&work->base); |