patch-2.4.20 linux-2.4.20/mm/vmalloc.c

Next file: linux-2.4.20/mm/vmscan.c
Previous file: linux-2.4.20/mm/swap_state.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/mm/vmalloc.c linux-2.4.20/mm/vmalloc.c
@@ -176,7 +176,13 @@
 	area = (struct vm_struct *) kmalloc(sizeof(*area), GFP_KERNEL);
 	if (!area)
 		return NULL;
+
 	size += PAGE_SIZE;
+	if (!size) {
+		kfree (area);
+		return NULL;
+	}
+
 	addr = VMALLOC_START;
 	write_lock(&vmlist_lock);
 	for (p = &vmlist; (tmp = *p) ; p = &tmp->next) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)