gpu: ion: fill in buffer->{dev,size} before mapping new buffers
authorGreg Hackmann <ghackmann@google.com>
Tue, 5 Jun 2012 20:23:42 +0000 (13:23 -0700)
committerArve Hjønnevåg <arve@android.com>
Mon, 1 Jul 2013 20:40:48 +0000 (13:40 -0700)
At least one map_dma() implementation (EXYNOS_CONTIG) assumes the fields
are filled in

Change-Id: I88c84dc5663df41f9aa9401b5f80fc2570f9dd95
Signed-off-by: Greg Hackmann <ghackmann@google.com>
drivers/gpu/ion/ion.c

index 50a4a407964689e3078d2ddf9af68604bc2bbca6..65582fb0a019d4f1ce651eb9bf5a6c032bdea6ad 100644 (file)
@@ -151,6 +151,9 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
                return ERR_PTR(ret);
        }
 
+       buffer->dev = dev;
+       buffer->size = len;
+
        table = buffer->heap->ops->map_dma(buffer->heap, buffer);
        if (IS_ERR_OR_NULL(table)) {
                heap->ops->free(buffer);
@@ -159,8 +162,6 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
        }
        buffer->sg_table = table;
 
-       buffer->dev = dev;
-       buffer->size = len;
        mutex_init(&buffer->lock);
        ion_buffer_add(dev, buffer);
        return buffer;