[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1321382968.8791.4.camel@localhost.localdomain>
Date: Wed, 16 Nov 2011 00:49:28 +0600
From: Rakib Mullick <rakib.mullick@...il.com>
To: dri-devel <dri-devel@...ts.freedesktop.org>,
linux-kernel@...r.kernel.org
Cc: David Airlie <airlied@...ux.ie>, Keith Packard <keithp@...thp.com>,
akpm@...ux-foundation.org
Subject: [PATCH] drm, i915: Fix memory leak in i915_gem_busy_ioctl().
A call to i915_add_request() has been made in function i915_gem_busy_ioctl(). i915_add_request can fail,
so in it's exit path previously allocated memory needs to be freed.
Signed-off-by: Rakib Mullick <rakib.mullick@...il.com>
---
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d18b07a..2dc24ab 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3512,9 +3512,11 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data,
* so emit a request to do so.
*/
request = kzalloc(sizeof(*request), GFP_KERNEL);
- if (request)
+ if (request) {
ret = i915_add_request(obj->ring, NULL, request);
- else
+ if (ret)
+ kfree(request);
+ } else
ret = -ENOMEM;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists