From: Colin Cross Date: Sat, 14 Dec 2013 03:26:20 +0000 (-0800) Subject: ion: add alignment check to carveout heap X-Git-Tag: next-20131220~15^2~144 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f0f06763820e5b5f6e13afa814e68e8f4d955c45;p=karo-tx-linux.git ion: add alignment check to carveout heap Signed-off-by: Colin Cross Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/android/ion/ion_carveout_heap.c b/drivers/staging/android/ion/ion_carveout_heap.c index 1d53e9120b90..b0b08c30f6f0 100644 --- a/drivers/staging/android/ion/ion_carveout_heap.c +++ b/drivers/staging/android/ion/ion_carveout_heap.c @@ -70,6 +70,9 @@ static int ion_carveout_heap_allocate(struct ion_heap *heap, unsigned long size, unsigned long align, unsigned long flags) { + if (align > PAGE_SIZE) + return -EINVAL; + buffer->priv_phys = ion_carveout_allocate(heap, size, align); return buffer->priv_phys == ION_CARVEOUT_ALLOCATE_FAIL ? -ENOMEM : 0; }