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

Commit 9fa8af91 authored by Marek Szyprowski's avatar Marek Szyprowski
Browse files

ARM: dma-mapping: fix error path for memory allocation failure



This patch fixes incorrect check in error path. When the allocation of
first page fails, the kernel ops appears due to accessing -1 element of
the pages array.

Reported-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
parent 50262a4b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -961,7 +961,7 @@ static struct page **__iommu_alloc_buffer(struct device *dev, size_t size, gfp_t

	return pages;
error:
	while (--i)
	while (i--)
		if (pages[i])
			__free_pages(pages[i], 0);
	if (array_size <= PAGE_SIZE)