diff options
author | Quinn Jensen <quinn.jensen@freescale.com> | 2007-10-24 21:23:13 -0600 |
---|---|---|
committer | Quinn Jensen <quinn.jensen@freescale.com> | 2007-10-24 21:23:13 -0600 |
commit | e611ea00d04e3c4cac46a71f14042b749f1d4008 (patch) | |
tree | b08204054a361cd1c46898b1916cc0df75e08638 | |
parent | b34ab626c318db46d16692ea7a0cb772cc4ed241 (diff) |
ioremap: control reaches end of non-void function.
This fixes a bug in ioremap: control reaches end of non-void function.
Patch was posted to the linux-arm-kernel mailing list.
This problem occurs only when BUG is not defined. Applies to linux
2.6.22 kernel for ARM processors.
http://www.bitshrine.org/gpp/linux-2.6.22-mx-ioremap-control-reaches-end-of-non-void-fu.patch
-rw-r--r-- | arch/arm/mm/ioremap.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index f3ade18862aa..ac52102bbb20 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c @@ -52,18 +52,17 @@ static int remap_area_pte(pmd_t *pmd, unsigned long addr, unsigned long end, return -ENOMEM; do { - if (!pte_none(*pte)) - goto bad; + if (!pte_none(*pte)) { + printk(KERN_CRIT "remap_area_pte: page already exists\n"); + BUG(); + return -EFAULT; + } set_pte_ext(pte, pfn_pte(phys_addr >> PAGE_SHIFT, prot), type->prot_pte_ext); phys_addr += PAGE_SIZE; } while (pte++, addr += PAGE_SIZE, addr != end); return 0; - - bad: - printk(KERN_CRIT "remap_area_pte: page already exists\n"); - BUG(); } static inline int remap_area_pmd(pgd_t *pgd, unsigned long addr, |