diff options
author | Linas Vepstas <linas@linas.org> | 2005-11-04 01:55:14 +0100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-10 05:30:31 +0100 |
commit | d177c207ba16b1db31283e2d1fee7ad4a863584b (patch) | |
tree | 8afca673d77c1a15585b96df977e39601db535f5 /arch/powerpc/mm/pgtable_64.c | |
parent | [PATCH] powerpc: handle multifunction PCI devices properly (diff) | |
download | linux-d177c207ba16b1db31283e2d1fee7ad4a863584b.tar.xz linux-d177c207ba16b1db31283e2d1fee7ad4a863584b.zip |
[PATCH] powerpc: IOMMU: don't ioremap null addresses
240-ioremap-null-ptr-test.patch
Under highly unusual circumstances, a buggy driver will ask a null ptr
to be ioremapped, an operation that curently succeeds but leads to
later trouble. Instead, refuse to remap the null pointer.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
(cherry picked from e71d9e598533c1889e7162f5f4647e5d378c102c commit)
Diffstat (limited to 'arch/powerpc/mm/pgtable_64.c')
-rw-r--r-- | arch/powerpc/mm/pgtable_64.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c index 2ffca63602c5..7b278d83739e 100644 --- a/arch/powerpc/mm/pgtable_64.c +++ b/arch/powerpc/mm/pgtable_64.c @@ -174,7 +174,7 @@ void __iomem * __ioremap(unsigned long addr, unsigned long size, pa = addr & PAGE_MASK; size = PAGE_ALIGN(addr + size) - pa; - if (size == 0) + if ((size == 0) || (pa == 0)) return NULL; if (mem_init_done) { |