diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2014-06-04 19:05:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-04 19:53:53 -0400 |
commit | 2accff4ef5c5831a9cc6319394a9f61cc9de8534 (patch) | |
tree | e60a28198315d86e17f40fe5ff3f0da5f03e84ff /arch/unicore32 | |
parent | acc8a1c00585c5cd62fcafd9309ef40ac35e8bfa (diff) |
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/unicore32')
-rw-r--r-- | arch/unicore32/mm/ioremap.c | 4 |
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, | |||
143 | /* | 143 | /* |
144 | * Don't allow RAM to be mapped | 144 | * Don't allow RAM to be mapped |
145 | */ | 145 | */ |
146 | if (pfn_valid(pfn)) | 146 | if (pfn_valid(pfn)) { |
147 | WARN(1, "BUG: Your driver calls ioremap() on\n" | 147 | WARN(1, "BUG: Your driver calls ioremap() on\n" |
148 | "system memory. This leads to architecturally\n" | 148 | "system memory. This leads to architecturally\n" |
149 | "unpredictable behaviour, and ioremap() will fail in\n" | 149 | "unpredictable behaviour, and ioremap() will fail in\n" |
150 | "the next kernel release. Please fix your driver.\n"); | 150 | "the next kernel release. Please fix your driver.\n"); |
151 | return NULL; | ||
152 | } | ||
151 | 153 | ||
152 | type = get_mem_type(mtype); | 154 | type = get_mem_type(mtype); |
153 | if (!type) | 155 | if (!type) |