[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1307912024-14190-1-git-send-email-chris@chris-wilson.co.uk>
Date: Sun, 12 Jun 2011 21:53:44 +0100
From: Chris Wilson <chris@...is-wilson.co.uk>
To: linux-kernel@...r.kernel.org
Cc: dri-devel@...ts.freedesktop.org, intel-gfx@...ts.freedesktop.org,
Jesper Juhl <jj@...osbits.net>,
Chris Wilson <chris@...is-wilson.co.uk>
Subject: [PATCH] drm/i915: Don't leak in i915_gem_shmem_pread_slow()
From: Jesper Juhl <jj@...osbits.net>
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>
Signed-off-by: Chris Wilson <chris@...is-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 12d3257..94c84d7 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))
- return PTR_ERR(page);
+ if (IS_ERR(page)) {
+ ret = PTR_ERR(page);
+ goto out;
+ }
if (do_bit17_swizzling) {
slow_shmem_bit17_copy(page,
--
1.7.5.3
--
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