aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2011-06-12 16:53:44 -0400
committerDave Airlie <airlied@redhat.com>2011-06-13 21:00:54 -0400
commitb65552f06ca866f587a0a50d1f4dbdd3a00ec532 (patch)
tree081841bdd06757d84e3990a02b24777c11431348 /drivers/gpu
parenta27bb4b209dd6c327fa4e7185f2487f9508a58db (diff)
drm/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@chaosbits.net> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c6
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 12d32579b95..94c84d74410 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,
465 465
466 page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT, 466 page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT,
467 GFP_HIGHUSER | __GFP_RECLAIMABLE); 467 GFP_HIGHUSER | __GFP_RECLAIMABLE);
468 if (IS_ERR(page)) 468 if (IS_ERR(page)) {
469 return PTR_ERR(page); 469 ret = PTR_ERR(page);
470 goto out;
471 }
470 472
471 if (do_bit17_swizzling) { 473 if (do_bit17_swizzling) {
472 slow_shmem_bit17_copy(page, 474 slow_shmem_bit17_copy(page,