===== net/ipv4/fib_hash.c 1.21 vs edited ===== --- 1.21/net/ipv4/fib_hash.c 2004-09-22 06:35:25 +10:00 +++ edited/net/ipv4/fib_hash.c 2004-09-22 13:05:41 +10:00 @@ -109,7 +109,7 @@ { unsigned long size = divisor * sizeof(struct hlist_head); - if (divisor <= 1024) { + if (size <= PAGE_SIZE) { return kmalloc(size, GFP_KERNEL); } else { return (struct hlist_head *) @@ -141,11 +141,12 @@ static void fz_hash_free(struct hlist_head *hash, int divisor) { - if (divisor <= 1024) + unsigned long size = divisor * sizeof(struct hlist_head); + + if (size <= PAGE_SIZE) kfree(hash); else - free_pages((unsigned long) hash, - get_order(divisor * sizeof(struct hlist_head))); + free_pages((unsigned long)hash, get_order(size)); } static void fn_rehash_zone(struct fn_zone *fz)