* [PATCH?] mm/vmalloc.c
@ 2001-05-18 17:20 Thiago Rondon
0 siblings, 0 replies; only message in thread
From: Thiago Rondon @ 2001-05-18 17:20 UTC (permalink / raw)
To: linux mm
This is a stupid patch, just to "clean" the code.
--- vmalloc.c.orig Thu May 17 13:42:43 2001
+++ vmalloc.c Thu May 17 13:43:38 2001
@@ -180,19 +180,13 @@
addr = VMALLOC_START;
write_lock(&vmlist_lock);
for (p = &vmlist; (tmp = *p) ; p = &tmp->next) {
- if ((size + addr) < addr) {
- write_unlock(&vmlist_lock);
- kfree(area);
- return NULL;
- }
+ if ((size + addr) < addr)
+ goto out;
if (size + addr < (unsigned long) tmp->addr)
break;
addr = tmp->size + (unsigned long) tmp->addr;
- if (addr > VMALLOC_END-size) {
- write_unlock(&vmlist_lock);
- kfree(area);
- return NULL;
- }
+ if (addr > VMALLOC_END-size)
+ goto out;
}
area->flags = flags;
area->addr = (void *)addr;
@@ -201,6 +195,11 @@
*p = area;
write_unlock(&vmlist_lock);
return area;
+
+out:
+ write_unlock(&vmlist_lock);
+ kfree(area);
+ return NULL;
}
void vfree(void * addr)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-05-18 17:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-18 17:20 [PATCH?] mm/vmalloc.c Thiago Rondon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox