tree 825a423b38fc88e8399c998ec3f8cec0b0b641c4 parent e26ac8cb3ea071c8180e7863c1e0bd285e507ddf author Gustavo Zacarias <[EMAIL PROTECTED]> Tue, 23 Aug 2005 03:31:24 -0700 committer David S. Miller <[EMAIL PROTECTED]> Tue, 23 Aug 2005 03:31:24 -0700
[SPARC64]: Use vmalloc() in do_netfilter_replace() Otherwise the number of rules one can upload into the kernel is severely limited. Signed-off-by: David S. Miller <[EMAIL PROTECTED]> arch/sparc64/kernel/sys_sparc32.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c --- a/arch/sparc64/kernel/sys_sparc32.c +++ b/arch/sparc64/kernel/sys_sparc32.c @@ -50,6 +50,7 @@ #include <linux/in.h> #include <linux/icmpv6.h> #include <linux/sysctl.h> +#include <linux/vmalloc.h> #include <linux/dnotify.h> #include <linux/netfilter_ipv4/ip_tables.h> @@ -2919,12 +2920,12 @@ static int do_netfilter_replace(int fd, if (optlen != kreplsize) return -ENOPROTOOPT; - krepl = (struct ipt_replace *)kmalloc(kreplsize, GFP_KERNEL); + krepl = (struct ipt_replace *)vmalloc(kreplsize); if (krepl == NULL) return -ENOMEM; if (copy_from_user(krepl, optval, kreplsize)) { - kfree(krepl); + vfree(krepl); return -EFAULT; } @@ -2932,10 +2933,9 @@ static int do_netfilter_replace(int fd, ((struct ipt_replace32 *)krepl)->counters); kcountersize = krepl->num_counters * sizeof(struct ipt_counters); - krepl->counters = (struct ipt_counters *)kmalloc( - kcountersize, GFP_KERNEL); + krepl->counters = (struct ipt_counters *)vmalloc(kcountersize); if (krepl->counters == NULL) { - kfree(krepl); + vfree(krepl); return -ENOMEM; } @@ -2949,8 +2949,8 @@ static int do_netfilter_replace(int fd, copy_to_user(counters32, krepl->counters, kcountersize)) ret = -EFAULT; - kfree(krepl->counters); - kfree(krepl); + vfree(krepl->counters); + vfree(krepl); return ret; } - To unsubscribe from this list: send the line "unsubscribe git-commits-24" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html