[Intel-gfx] [PATCH] drm/i915/selftests: Fix resource leak in __sseu_prepare
Radhakrishna Sripada
radhakrishna.sripada at intel.com
Fri Feb 15 19:35:54 UTC 2019
Fix the resource leak reported by static code checker.
Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada at intel.com>
---
drivers/gpu/drm/i915/selftests/i915_gem_context.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/selftests/i915_gem_context.c
index d00d0bb07784..0d821a679f74 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_context.c
@@ -726,14 +726,13 @@ __sseu_prepare(struct drm_i915_private *i915,
ret = igt_spinner_init(spin, i915);
if (ret)
- return ret;
+ goto clean;
rq = igt_spinner_create_request(spin, ctx, engine, MI_NOOP);
if (IS_ERR(rq)) {
ret = PTR_ERR(rq);
igt_spinner_fini(spin);
- kfree(spin);
- goto out;
+ goto clean;
}
i915_request_add(rq);
@@ -742,14 +741,16 @@ __sseu_prepare(struct drm_i915_private *i915,
pr_err("%s: Spinner failed to start!\n", name);
igt_spinner_end(spin);
igt_spinner_fini(spin);
- kfree(spin);
ret = -ETIMEDOUT;
- goto out;
+ goto clean;
}
*spin_out = spin;
+ goto out;
}
+clean:
+ kfree(spin);
out:
return ret;
}
--
2.20.0.rc2.7.g965798d1f299
More information about the Intel-gfx
mailing list