From: Colin Cross Date: Tue, 26 Nov 2013 21:43:29 +0000 (-0800) Subject: ion: add alignment check to carveout heap X-Git-Tag: firefly_0821_release~4090^2~449 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=63ddadde39e91931890798084ef023ebab4b4a90;p=firefly-linux-kernel-4.4.55.git ion: add alignment check to carveout heap Change-Id: I25c752b3eacb48cccea5be2df319634b3affd331 Signed-off-by: Colin Cross --- diff --git a/drivers/staging/android/ion/ion_carveout_heap.c b/drivers/staging/android/ion/ion_carveout_heap.c index ed2b7ae70964..128ee115e60e 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; }