Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b65552f0 authored by Jesper Juhl's avatar Jesper Juhl Committed by Dave Airlie
Browse files

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: default avatarJesper Juhl <jj@chaosbits.net>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent a27bb4b2
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -465,8 +465,10 @@ i915_gem_shmem_pread_slow(struct drm_device *dev,


		page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT,
		page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT,
					   GFP_HIGHUSER | __GFP_RECLAIMABLE);
					   GFP_HIGHUSER | __GFP_RECLAIMABLE);
		if (IS_ERR(page))
		if (IS_ERR(page)) {
			return PTR_ERR(page);
			ret = PTR_ERR(page);
			goto out;
		}


		if (do_bit17_swizzling) {
		if (do_bit17_swizzling) {
			slow_shmem_bit17_copy(page,
			slow_shmem_bit17_copy(page,