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

Commit b6152016 authored by Gioh Kim's avatar Gioh Kim Committed by Greg Kroah-Hartman
Browse files

Staging: android: ion: duplicated clearing of sg_table



Because sg_table is cleared in sg_alloc_table via memset we don't need to use
kzalloc to allocate sg_table.

Signed-off-by: default avatarGioh Kim <gioh.kim@lge.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d7a33d74
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ static int ion_carveout_heap_allocate(struct ion_heap *heap,
	if (align > PAGE_SIZE)
		return -EINVAL;

	table = kzalloc(sizeof(struct sg_table), GFP_KERNEL);
	table = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
	if (!table)
		return -ENOMEM;
	ret = sg_alloc_table(table, 1, GFP_KERNEL);
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ static int ion_chunk_heap_allocate(struct ion_heap *heap,
	if (allocated_size > chunk_heap->size - chunk_heap->allocated)
		return -ENOMEM;

	table = kzalloc(sizeof(struct sg_table), GFP_KERNEL);
	table = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
	if (!table)
		return -ENOMEM;
	ret = sg_alloc_table(table, num_chunks, GFP_KERNEL);
+2 −2
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ static int ion_system_heap_allocate(struct ion_heap *heap,
		max_order = info->order;
		i++;
	}
	table = kzalloc(sizeof(struct sg_table), GFP_KERNEL);
	table = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
	if (!table)
		goto err;

@@ -356,7 +356,7 @@ static int ion_system_contig_heap_allocate(struct ion_heap *heap,
	for (i = len >> PAGE_SHIFT; i < (1 << order); i++)
		__free_page(page + i);

	table = kzalloc(sizeof(struct sg_table), GFP_KERNEL);
	table = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
	if (!table) {
		ret = -ENOMEM;
		goto out;