summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2014-06-05 01:05:54 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-05 01:53:53 +0200
commit2accff4ef5c5831a9cc6319394a9f61cc9de8534 (patch)
treee60a28198315d86e17f40fe5ff3f0da5f03e84ff /arch
parentarch/unicore32/mm/ioremap.c: convert printk/warn_on to warn() (diff)
downloadlinux-2accff4ef5c5831a9cc6319394a9f61cc9de8534.tar.xz
linux-2accff4ef5c5831a9cc6319394a9f61cc9de8534.zip
arch/unicore32/mm/ioremap.c: return NULL on invalid pfn
__uc32_ioremap_pfn_caller() should return NULL when the pfn is found to be invalid. From a recommendation by Guan Xuetao. Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Cc: Fabian Frederick <fabf@skynet.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/unicore32/mm/ioremap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/unicore32/mm/ioremap.c b/arch/unicore32/mm/ioremap.c
index a0840fa05431..bf012b2b71a9 100644
--- a/arch/unicore32/mm/ioremap.c
+++ b/arch/unicore32/mm/ioremap.c
@@ -143,11 +143,13 @@ void __iomem *__uc32_ioremap_pfn_caller(unsigned long pfn,
/*
* Don't allow RAM to be mapped
*/
- if (pfn_valid(pfn))
+ if (pfn_valid(pfn)) {
WARN(1, "BUG: Your driver calls ioremap() on\n"
"system memory. This leads to architecturally\n"
"unpredictable behaviour, and ioremap() will fail in\n"
"the next kernel release. Please fix your driver.\n");
+ return NULL;
+ }
type = get_mem_type(mtype);
if (!type)