Skip to content

Commit b65552f

Browse files
jjuhlairlied
authored andcommitted
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>
1 parent a27bb4b commit b65552f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎drivers/gpu/drm/i915/i915_gem.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,10 @@ i915_gem_shmem_pread_slow(struct drm_device *dev,
465465

466466
page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT,
467467
GFP_HIGHUSER | __GFP_RECLAIMABLE);
468-
if (IS_ERR(page))
469-
return PTR_ERR(page);
468+
if (IS_ERR(page)) {
469+
ret = PTR_ERR(page);
470+
goto out;
471+
}
470472

471473
if (do_bit17_swizzling) {
472474
slow_shmem_bit17_copy(page,

0 commit comments

Comments
 (0)