Skip to content

Commit 64dc802

Browse files
Abdiel Janulgueickle
authored andcommitted
drm/i915/phys: unconditionally call release_memory_region
The release method will undo what we did at creation, and so we shouldn't care if we have pages or not. Fixes a small leak in the mock_phys selftest. Signed-off-by: Abdiel Janulgue <[email protected]> Signed-off-by: Matthew Auld <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Signed-off-by: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 47f8253 commit 64dc802

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/gpu/drm/i915/gem/i915_gem_phys.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,11 @@ int i915_gem_object_attach_phys(struct drm_i915_gem_object *obj, int align)
194194
/* Perma-pin (until release) the physical set of pages */
195195
__i915_gem_object_pin_pages(obj);
196196

197-
if (!IS_ERR_OR_NULL(pages)) {
197+
if (!IS_ERR_OR_NULL(pages))
198198
i915_gem_shmem_ops.put_pages(obj, pages);
199-
i915_gem_object_release_memory_region(obj);
200-
}
199+
200+
i915_gem_object_release_memory_region(obj);
201+
201202
mutex_unlock(&obj->mm.lock);
202203
return 0;
203204

0 commit comments

Comments
 (0)