From: Ard Biesheuvel Date: Wed, 29 Oct 2014 16:09:32 +0000 (+0100) Subject: of: check for size < 0 after rounding in early_init_dt_add_memory_arch X-Git-Tag: omap-for-v3.19/fixes-rc1~127^2~36 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8cccffc52694938fc88f3d90bc7fed8460e27191;p=pandora-kernel.git of: check for size < 0 after rounding in early_init_dt_add_memory_arch Memory regions passed to early_init_dt_add_memory_arch() are rounded to PAGE_SIZE by subtracting the size of the leading fractional page from the 'size' argument. However, size being a u64 type, if its value is sufficiently small, the subtraction wraps around and produces a bogus value, potentially leading to crashes. Fix this by ignoring the memory range in such cases. Signed-off-by: Ard Biesheuvel Signed-off-by: Grant Likely --- Reading git-diff-tree failed