From: Madhusudanan Kandasamy Date: Thu, 10 Jul 2014 15:15:13 +0000 (+0530) Subject: powerpc: Fail remap_4k_pfn() if PFN doesn't fit inside PTE X-Git-Tag: omap-for-v3.17/fixes-against-rc2~134^2~7 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eeb03a6eaa02e9171f91e385c52a69b159fc6117;p=pandora-kernel.git powerpc: Fail remap_4k_pfn() if PFN doesn't fit inside PTE remap_4k_pfn() silently truncates upper bits of input 4K PFN if it cannot be contained in PTE. This leads invalid memory mapping and could result in a system crash when the memory is accessed. This patch fails remap_4k_pfn() and returns -EINVAL if the input 4K PFN cannot be contained in PTE. V3 : Added parentheses to protect 'pfn' and entire macro as suggested by Brian. V2 : Rewritten to avoid helper function as suggested by Stephen Rothwell. Signed-off-by: Madhusudanan Kandasamy Signed-off-by: Benjamin Herrenschmidt --- Reading git-diff-tree failed