Commit dd608dd2 authored by Colin Cross's avatar Colin Cross Committed by Greg Kroah-Hartman

ion: add alignment check to chunk heap

Signed-off-by: default avatarColin Cross <ccross@android.com>
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent df6cf5c8
...@@ -47,6 +47,9 @@ static int ion_chunk_heap_allocate(struct ion_heap *heap, ...@@ -47,6 +47,9 @@ static int ion_chunk_heap_allocate(struct ion_heap *heap,
unsigned long num_chunks; unsigned long num_chunks;
unsigned long allocated_size; unsigned long allocated_size;
if (align > chunk_heap->chunk_size)
return -EINVAL;
allocated_size = ALIGN(size, chunk_heap->chunk_size); allocated_size = ALIGN(size, chunk_heap->chunk_size);
num_chunks = allocated_size / chunk_heap->chunk_size; num_chunks = allocated_size / chunk_heap->chunk_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment