]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
drm/i915: Don't call sg_free_table() if sg_alloc_table() fails
authorDamien Lespiau <damien.lespiau@intel.com>
Fri, 30 Aug 2013 14:39:26 +0000 (15:39 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 3 Sep 2013 17:18:00 +0000 (19:18 +0200)
One needs to call __sg_free_table() if __sg_alloc_table() fails, but
sg_alloc_table() does that for us already.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewd-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c

index 61313054fce6b90bd495330880d48a03eb541db5..f21a0c36a40b31d70dbeebe1dcfec0a1a2d73e75 100644 (file)
@@ -1774,7 +1774,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;
        }