linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] drm/i915/selftests: fix memory leak of 'spin'
@ 2019-02-19 15:01 Colin King
  2019-02-19 15:08 ` Chris Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2019-02-19 15:01 UTC (permalink / raw)
  To: Joonas Lahtinen, Rodrigo Vivi, David Airlie, Daniel Vetter,
	Chris Wilson, intel-gfx, dri-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

There is a memory leak of 'spin' on an error return path. Fix this by
kfree'ing spin before the return.

Fixes: c06ee6ff2cbc ("drm/i915/selftests: Context SSEU reconfiguration tests")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/i915/selftests/i915_gem_context.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/selftests/i915_gem_context.c
index d00d0bb07784..cf988797bb17 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_context.c
@@ -725,8 +725,10 @@ __sseu_prepare(struct drm_i915_private *i915,
 		}
 
 		ret = igt_spinner_init(spin, i915);
-		if (ret)
+		if (ret) {
+			kfree(spin);
 			return ret;
+		}
 
 		rq = igt_spinner_create_request(spin, ctx, engine, MI_NOOP);
 		if (IS_ERR(rq)) {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] drm/i915/selftests: fix memory leak of 'spin'
  2019-02-19 15:01 [PATCH][next] drm/i915/selftests: fix memory leak of 'spin' Colin King
@ 2019-02-19 15:08 ` Chris Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Wilson @ 2019-02-19 15:08 UTC (permalink / raw)
  To: Colin King, Daniel Vetter, David Airlie, Joonas Lahtinen,
	Rodrigo Vivi, dri-devel, intel-gfx
  Cc: kernel-janitors, linux-kernel

Quoting Colin King (2019-02-19 15:01:29)
> From: Colin Ian King <colin.king@canonical.com>
> 
> There is a memory leak of 'spin' on an error return path. Fix this by
> kfree'ing spin before the return.
> 
> Fixes: c06ee6ff2cbc ("drm/i915/selftests: Context SSEU reconfiguration tests")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

I hope already fixed by

commit 2a4a2754039594c60b58b02b6781428a85f6d745
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Feb 15 19:50:10 2019 +0000

    drm/i915/selftests: Always free spinner on __sseu_prepare error

Thanks,
-Chris

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-19 15:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-19 15:01 [PATCH][next] drm/i915/selftests: fix memory leak of 'spin' Colin King
2019-02-19 15:08 ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).