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

Commit ee3ea93d authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "arm: dma-mapping: return NULL on remap error"

parents f987fcc1 60ef0156
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -791,13 +791,15 @@ static void *arm_dma_remap(struct device *dev, void *cpu_addr,
			dma_addr_t handle, size_t size,
			struct dma_attrs *attrs)
{
	void *ptr;
	struct page *page = pfn_to_page(dma_to_pfn(dev, handle));
	pgprot_t prot = __get_dma_pgprot(attrs, PAGE_KERNEL);
	unsigned long offset = handle & ~PAGE_MASK;

	size = PAGE_ALIGN(size + offset);
	return __dma_alloc_remap(page, size, GFP_KERNEL, prot,
				__builtin_return_address(0)) + offset;
	ptr = __dma_alloc_remap(page, size, GFP_KERNEL, prot,
				__builtin_return_address(0));
	return ptr ? ptr + offset : ptr;
}

static void arm_dma_unremap(struct device *dev, void *remapped_addr,