Skip to content

Commit

Permalink
drm/i915: Don't leak in i915_gem_shmem_pread_slow()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jesper Juhl authored and Dave Airlie committed Jun 14, 2011
1 parent a27bb4b commit b65552f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b65552f

Please sign in to comment.