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

Commit 65e0280a authored by Shiraz Hashim's avatar Shiraz Hashim
Browse files

drivers: dma-removed: Don't free prohibited memmap entries



The mm subsystem access page structs aligned to
pageblock_nr_pages and assumes that these are valid. We
must not free any memmap entries that it may inspect.

CRs-Fixed: 1000343
Change-Id: I73e0402ee72cad8df307ece1134f9e7304125cf6
Signed-off-by: default avatarShiraz Hashim <shashim@codeaurora.org>
parent ec82f6fd
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/*
 *
 *  Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 *  Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
 *  Copyright (C) 2000-2004 Russell King
 *
 * This program is free software; you can redistribute it and/or modify
@@ -134,6 +134,8 @@ static void free_memmap(unsigned long start_pfn, unsigned long end_pfn)
	struct page *start_pg, *end_pg;
	unsigned long pg, pgend;

	start_pfn = ALIGN(start_pfn, pageblock_nr_pages);
	end_pfn = round_down(end_pfn, pageblock_nr_pages);
	/*
	 * Convert start_pfn/end_pfn to a struct page pointer.
	 */