netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: jchandra@digeo.com
Cc: bridge@osdl.org, bdschuym@pandora.be, netdev@vger.kernel.org,
	akpm@osdl.org
Subject: Re: [RESEND][PATCH] ebtables: clean up vmalloc usage in net/bridge/netfilter/ebtables.c
Date: Wed, 19 Apr 2006 15:41:26 -0700 (PDT)	[thread overview]
Message-ID: <20060419.154126.64036253.davem@davemloft.net> (raw)
In-Reply-To: <20060419065025.GE17192@random.pao.digeo.com>


An earlier variant of your patch was applied already, included below.
You'll need to submit the newer parts relative to the current tree.

diff-tree 7ad4d2f6901437ba4717a26d395a73ea362d25c6 (from b8282dcf0417bbc8a0786c129fdff9cc768f8f3c)
Author: Jayachandran C <c.jayachandran@gmail.com>
Date:   Tue Apr 11 17:25:38 2006 -0700

    [BRIDGE] ebtables: fix allocation in net/bridge/netfilter/ebtables.c
    
    Allocate an array of 'struct ebt_chainstack *', the current code allocates
    array of 'struct ebt_chainstack'.
    
    akpm: converted to use the
    
    	foo = alloc(sizeof(*foo))
    
    form.  Which would have prevented this from happening in the first place.
    
    akpm: also removed unneeded typecast.
    
    akpm: what on earth is this code doing anyway?  cpu_possible_map can be
    sparse..
    
    Signed-off-by: Jayachandran C. <c.jayachandran@gmail.com>
    Signed-off-by: Andrew Morton <akpm@osdl.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 66bd932..84b9af7 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -824,9 +824,9 @@ static int translate_table(struct ebt_re
 	if (udc_cnt) {
 		/* this will get free'd in do_replace()/ebt_register_table()
 		   if an error occurs */
-		newinfo->chainstack = (struct ebt_chainstack **)
-		   vmalloc((highest_possible_processor_id()+1) 
-				   		* sizeof(struct ebt_chainstack));
+		newinfo->chainstack =
+			vmalloc((highest_possible_processor_id()+1)
+				   	* sizeof(*(newinfo->chainstack)));
 		if (!newinfo->chainstack)
 			return -ENOMEM;
 		for_each_possible_cpu(i) {

  reply	other threads:[~2006-04-19 22:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-19  6:50 [RESEND][PATCH] ebtables: clean up vmalloc usage in net/bridge/netfilter/ebtables.c Jayachandran C
2006-04-19 22:41 ` David S. Miller [this message]
2006-04-19 22:59   ` Andrew Morton
2006-04-19 23:03     ` David S. Miller
2006-04-19 23:13       ` Andrew Morton
2006-04-20  7:32         ` Jayachandran C

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060419.154126.64036253.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=akpm@osdl.org \
    --cc=bdschuym@pandora.be \
    --cc=bridge@osdl.org \
    --cc=jchandra@digeo.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).