[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1106102336560.21722@swampdragon.chaosbits.net>
Date: Fri, 10 Jun 2011 23:40:47 +0200 (CEST)
From: Jesper Juhl <jj@...osbits.net>
To: linux-kernel@...r.kernel.org
cc: dri-devel@...ts.freedesktop.org, David Airlie <airlied@...ux.ie>,
Keith Packard <keithp@...thp.com>
Subject: [PATCH] i915: Don't leak in i915_gem_shmem_pread_slow()..
It seems to me that we are leaking 'user_pages' in
drivers/gpu/drm/i915/i915_gem.c::i915_gem_shmem_pread_slow() if
read_cache_page_gfp() fails.
Signed-off-by: Jesper Juhl <jj@...osbits.net>
---
i915_gem.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Untested patch - user be warned.
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 12d3257..4df3272 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -465,8 +465,10 @@ i915_gem_shmem_pread_slow(struct drm_device *dev,
page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT,
GFP_HIGHUSER | __GFP_RECLAIMABLE);
- if (IS_ERR(page))
+ if (IS_ERR(page)) {
+ drm_free_large(user_pages);
return PTR_ERR(page);
+ }
if (do_bit17_swizzling) {
slow_shmem_bit17_copy(page,
--
Jesper Juhl <jj@...osbits.net> http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.
--
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