From: Zubair Lutfullah Kakakhel Date: Tue, 28 Oct 2014 11:28:34 +0000 (+0000) Subject: MIPS: CMA: Do not reserve memory if not required X-Git-Tag: omap-for-v3.19/fixes-for-merge-window~148^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30fa0530ff87f6379e046629adfa3f4872a2d353;p=pandora-kernel.git MIPS: CMA: Do not reserve memory if not required Even if CMA is disabled, the for_each_memblock macro expands to run reserve_bootmem once. Hence, reserve_bootmem attempts to reserve location 0 of size 0. Add a check to avoid that. Issue was highlighted during testing with EVA enabled. resrve_bootmem used to exit gracefully when passed arguments to reserve 0 size location at 0 without EVA. But with EVA enabled, macros would point to different addresses and the code would trigger a BUG. Signed-off-by: Zubair Lutfullah Kakakhel Tested-by: Markos Chandras Tested-by: Huacai Chen Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/8231/ Signed-off-by: Ralf Baechle --- Reading git-diff-tree failed