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: Shiraz Hashim <shashim@codeaurora.org>
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
diff --git a/drivers/base/dma-removed.c b/drivers/base/dma-removed.c
index b664a11..94e9aa3 100644
--- a/drivers/base/dma-removed.c
+++ b/drivers/base/dma-removed.c
@@ -1,6 +1,6 @@
/*
*
- * 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 @@
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.
*/