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

Commit 866a34db authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drivers: dma-removed: align size first" into msm-4.8

parents 7cdb46b6 dd9cc4c8
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -78,17 +78,19 @@ void *removed_alloc(struct device *dev, size_t size, dma_addr_t *handle,
	bool no_kernel_mapping = attrs & DMA_ATTR_NO_KERNEL_MAPPING;
	bool skip_zeroing = attrs & DMA_ATTR_SKIP_ZEROING;
	int pageno;
	unsigned long order = get_order(size);
	unsigned long order;
	void *addr = NULL;
	struct removed_region *dma_mem = dev->removed_mem;
	int nbits = size >> PAGE_SHIFT;
	int nbits;
	unsigned int align;

	size = PAGE_ALIGN(size);

	if (!gfpflags_allow_blocking(gfp))
		return NULL;

	size = PAGE_ALIGN(size);
	nbits = size >> PAGE_SHIFT;
	order = get_order(size);

	if (order > get_order(SZ_1M))
		order = get_order(SZ_1M);