Skip to contentSkip to conversation

drm/i915: Don't call sg_free_table() if sg_alloc_table() fails

PATCH Applied Damien Lespiau 3 participants 3 messages Aug 30, 2013 – Sep 2, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Don't call sg_free_table() if sg_alloc_table() fails

One needs to call __sg_free_table() if __sg_alloc_table() fails, but sg_alloc_table() does that for us already.

---
 drivers/gpu/drm/i915/i915_gem.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.c +0 -1
index f705314..8eb8e17 100644
@@ -1772,7 +1772,6 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj)
 
 	page_count = obj->base.size / PAGE_SIZE;
 	if (sg_alloc_table(st, page_count, GFP_KERNEL)) {
-		sg_free_table(st);
 		kfree(st);
 		return -ENOMEM;
 	}
Signature · 1 line
1.8.3.1
#2 lore raw
Quoted 6 lines · Chris Wilson
Quoted 4 lines · Damien Lespiau

One needs to call __sg_free_table() if __sg_alloc_table() fails, but sg_alloc_table() does that for us already.

Queued for -next, thanks for the patch.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch