Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Gioh Kim <gioh.kim@lge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Gioh Kim and committed by
Greg Kroah-Hartman
b6152016 d7a33d74

+4 -4
+1 -1
drivers/staging/android/ion/ion_carveout_heap.c
··· 81 81 if (align > PAGE_SIZE) 82 82 return -EINVAL; 83 83 84 - table = kzalloc(sizeof(struct sg_table), GFP_KERNEL); 84 + table = kmalloc(sizeof(struct sg_table), GFP_KERNEL); 85 85 if (!table) 86 86 return -ENOMEM; 87 87 ret = sg_alloc_table(table, 1, GFP_KERNEL);
+1 -1
drivers/staging/android/ion/ion_chunk_heap.c
··· 55 55 if (allocated_size > chunk_heap->size - chunk_heap->allocated) 56 56 return -ENOMEM; 57 57 58 - table = kzalloc(sizeof(struct sg_table), GFP_KERNEL); 58 + table = kmalloc(sizeof(struct sg_table), GFP_KERNEL); 59 59 if (!table) 60 60 return -ENOMEM; 61 61 ret = sg_alloc_table(table, num_chunks, GFP_KERNEL);
+2 -2
drivers/staging/android/ion/ion_system_heap.c
··· 166 166 max_order = info->order; 167 167 i++; 168 168 } 169 - table = kzalloc(sizeof(struct sg_table), GFP_KERNEL); 169 + table = kmalloc(sizeof(struct sg_table), GFP_KERNEL); 170 170 if (!table) 171 171 goto err; 172 172 ··· 356 356 for (i = len >> PAGE_SHIFT; i < (1 << order); i++) 357 357 __free_page(page + i); 358 358 359 - table = kzalloc(sizeof(struct sg_table), GFP_KERNEL); 359 + table = kmalloc(sizeof(struct sg_table), GFP_KERNEL); 360 360 if (!table) { 361 361 ret = -ENOMEM; 362 362 goto out;