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

Commit f0f06763 authored by Colin Cross's avatar Colin Cross Committed by Greg Kroah-Hartman
Browse files

ion: add alignment check to carveout heap

parent 797e88be
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;
}