Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80449
b: refs/heads/master
c: bd796ed
h: refs/heads/master
i:
  80447: ab401c1
v: v3
  • Loading branch information
Ingo Molnar committed Jan 30, 2008
1 parent 9adc856 commit 147ecc7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a8efa1cd51d6f6407df5f42d8f1a7e9fc7178d1a
refs/heads/master: bd796ed0232a036f5ab14ac68d0a05f791ebcc3b
19 changes: 13 additions & 6 deletions trunk/arch/x86/mm/ioremap_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,15 @@ void __init *early_ioremap(unsigned long phys_addr, unsigned long size)

/* Don't allow wraparound or zero size */
last_addr = phys_addr + size - 1;
if (!size || last_addr < phys_addr)
if (!size || last_addr < phys_addr) {
WARN_ON(1);
return NULL;
}

if (nesting >= FIX_BTMAPS_NESTING)
if (nesting >= FIX_BTMAPS_NESTING) {
WARN_ON(1);
return NULL;

}
early_ioremap_nested++;
/*
* Mappings have to be page-aligned
Expand All @@ -324,8 +327,10 @@ void __init *early_ioremap(unsigned long phys_addr, unsigned long size)
* Mappings have to fit in the FIX_BTMAP area.
*/
nrpages = size >> PAGE_SHIFT;
if (nrpages > NR_FIX_BTMAPS)
if (nrpages > NR_FIX_BTMAPS) {
WARN_ON(1);
return NULL;
}

/*
* Ok, go for it..
Expand All @@ -351,11 +356,13 @@ void __init early_iounmap(void *addr, unsigned long size)
unsigned int nesting;

nesting = --early_ioremap_nested;
WARN_ON(nesting < 0);

virt_addr = (unsigned long)addr;
if (virt_addr < fix_to_virt(FIX_BTMAP_BEGIN))
if (virt_addr < fix_to_virt(FIX_BTMAP_BEGIN)) {
WARN_ON(1);
return;

}
offset = virt_addr & ~PAGE_MASK;
nrpages = PAGE_ALIGN(offset + size - 1) >> PAGE_SHIFT;

Expand Down

0 comments on commit 147ecc7

Please sign in to comment.