diff options
author | Jesper Juhl <jj@chaosbits.net> | 2011-06-12 22:53:44 +0200 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-06-14 03:00:54 +0200 |
commit | b65552f06ca866f587a0a50d1f4dbdd3a00ec532 (patch) | |
tree | 081841bdd06757d84e3990a02b24777c11431348 /drivers | |
parent | drm/radeon/kms: do bounds checking for 3D_LOAD_VBPNTR and bump array limit (diff) | |
download | linux-b65552f06ca866f587a0a50d1f4dbdd3a00ec532.tar.xz linux-b65552f06ca866f587a0a50d1f4dbdd3a00ec532.zip |
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')
-rw-r--r-- | 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 12d32579b951..94c84d744100 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, |