diff mbox series

drm/i915: Don't leak the capture list items

Message ID 20211209141304.393479-1-thomas.hellstrom@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Don't leak the capture list items | expand

Commit Message

Thomas Hellström Dec. 9, 2021, 2:13 p.m. UTC
When we recently converted the capture code to use vma snapshots,
we forgot to free the struct i915_capture_list list items after use.

Fix that by bringing back a kfree.

Fixes: ff20afc4cee7 ("drm/i915: Update error capture code to avoid using the current vma state")
Cc: Ramalingam C <ramalingam.c@intel.com>
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_request.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Matthew Auld Dec. 9, 2021, 5:28 p.m. UTC | #1
On 09/12/2021 14:13, Thomas Hellström wrote:
> When we recently converted the capture code to use vma snapshots,
> we forgot to free the struct i915_capture_list list items after use.
> 
> Fix that by bringing back a kfree.
> 
> Fixes: ff20afc4cee7 ("drm/i915: Update error capture code to avoid using the current vma state")
> Cc: Ramalingam C <ramalingam.c@intel.com>
> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index 471cde0e9883..fe682b6902aa 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -307,6 +307,7 @@  void i915_request_free_capture_list(struct i915_capture_list *capture)
 		struct i915_capture_list *next = capture->next;
 
 		i915_vma_snapshot_put(capture->vma_snapshot);
+		kfree(capture);
 		capture = next;
 	}
 }