Skip to contentSkip to conversation

drm/i915/selftest: Fix potential memory leak

PATCH In review Pan Bian 3 participants 3 messages Jan 22, 2021

Subsystems (2)
lore
Share & tools
lore

Pan Bian

author
#0 lore raw

PATCH 1/1 drm/i915/selftest: Fix potential memory leak

Object out is not released on path that no VMA instance found. The root cause is jumping to an unexpected label on the error path.

Fixes a47e788c2310 ("drm/i915/selftests: Exercise CS TLB invalidation")
---
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c +1 -1
index c53a222e3dec..713770fb2b92 100644
@@ -1880,7 +1880,7 @@ static int igt_cs_tlb(void *arg)
 	vma = i915_vma_instance(out, vm, NULL);
 	if (IS_ERR(vma)) {
 		err = PTR_ERR(vma);
-		goto out_put_batch;
+		goto out_put_out;
 	}
 
 	err = i915_vma_pin(vma, 0, 0,
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw

Quoting Pan Bian (2021-01-22 01:56:40)

Quoted 2 lines

Object out is not released on path that no VMA instance found. The root cause is jumping to an unexpected label on the error path.

Wouldn't the root cause be whatever caused the allocation to fail?

Language notwithstanding,

-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/selftest: Fix potential memory leak

In reply to Pan Bian
== Series Details ==

== Series Details ==

Series: drm/i915/selftest: Fix potential memory leak
URL : https://patchwork.freedesktop.org/series/86181/
State : failure

== Summary ==

Applying: drm/i915/selftest: Fix potential memory leak Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
Falling back to patching base and 3-way merge... Auto-merging drivers/gpu/drm/i915/selftests/i915_gem_gtt.c No changes -- Patch already applied.

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx