diff options
-rw-r--r-- | arch/m68k/mm/kmap.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c index 46b7d6035aab..df620ac2a296 100644 --- a/arch/m68k/mm/kmap.c +++ b/arch/m68k/mm/kmap.c | |||
@@ -66,8 +66,10 @@ static struct vm_struct *get_io_area(unsigned long size) | |||
66 | for (p = &iolist; (tmp = *p) ; p = &tmp->next) { | 66 | for (p = &iolist; (tmp = *p) ; p = &tmp->next) { |
67 | if (size + addr < (unsigned long)tmp->addr) | 67 | if (size + addr < (unsigned long)tmp->addr) |
68 | break; | 68 | break; |
69 | if (addr > KMAP_END-size) | 69 | if (addr > KMAP_END-size) { |
70 | kfree(area); | ||
70 | return NULL; | 71 | return NULL; |
72 | } | ||
71 | addr = tmp->size + (unsigned long)tmp->addr; | 73 | addr = tmp->size + (unsigned long)tmp->addr; |
72 | } | 74 | } |
73 | area->addr = (void *)addr; | 75 | area->addr = (void *)addr; |