#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/version.h>
+#include <linux/vmalloc.h>
#include <linux/netfilter/x_tables.h>
#include <asm/atomic.h>
#include <asm/uaccess.h>
if (copy_from_user(p, memcpy, sizeof(struct geoip_info)) != 0)
goto free_p;
- s = kmalloc(p->count * sizeof(struct geoip_subnet), GFP_KERNEL);
+ s = vmalloc(p->count * sizeof(struct geoip_subnet));
if (s == NULL)
goto free_p;
if (copy_from_user(s, p->subnets, p->count * sizeof(struct geoip_subnet)) != 0)
spin_unlock_bh(&geoip_lock);
return p;
free_s:
- kfree(s);
+ vfree(s);
free_p:
kfree(p);
return NULL;
/* So now am unlinked or the only one alive, right ?
* What are you waiting ? Free up some memory!
*/
-
- kfree(p->subnets);
- kfree(p);
-
spin_unlock_bh(&geoip_lock);
+ vfree(p->subnets);
+ kfree(p);
return;
}