Netdev List
 help / color / mirror / Atom feed
From: Julian Anastasov <ja@ssi.bg>
To: Hans Schillstrom <hans.schillstrom@ericsson.com>
Cc: horms@verge.net.au, wensong@linux-vs.org,
	lvs-devel@vger.kernel.org, netdev@vger.kernel.org,
	netfilter-devel@vger.kernel.org, hans@schillstrom.com
Subject: Re: [PATCH 2/4] ipvs: take care of return value from protocol init_netns
Date: Wed, 25 Apr 2012 11:35:28 +0300 (EEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.1204251126420.1895@ja.ssi.bg> (raw)
In-Reply-To: <1335339821-29684-3-git-send-email-hans.schillstrom@ericsson.com>


	Hello,

On Wed, 25 Apr 2012, Hans Schillstrom wrote:

> ip_vs_create_timeout_table() can return NULL
> All functions protocol init_netns is affected of this patch.
> 
> Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
> ---

> diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c
> index 6a8d176..0b74795 100644
> --- a/net/netfilter/ipvs/ip_vs_proto.c
> +++ b/net/netfilter/ipvs/ip_vs_proto.c
> @@ -79,7 +79,7 @@ register_ip_vs_proto_netns(struct net *net, struct ip_vs_protocol *pp)
>  	atomic_set(&pd->appcnt, 0);	/* Init app counter */
>  
>  	if (pp->init_netns != NULL)
> -		pp->init_netns(net, pd);
> +		return pp->init_netns(net, pd);

	May be it is better to unlink and free the pd here
if init_netns fails. Currently, protocols attach only
allocated pointer (pd->timeout_table) and it is not a
big problem to call exit_netns on failure but lets do
it safely, every init handler should release its data on
failure and then we should not call exit_netns.

	Patch 1 looks ok and I'll ack it next time.

Regards

--
Julian Anastasov <ja@ssi.bg>

      reply	other threads:[~2012-04-25  8:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-25  7:43 [PATCH 0/2] ipvs: netns avoid crash at netns init Hans Schillstrom
2012-04-25  7:43 ` [PATCH 1/2] ipvs: null check of net->ipvs in lblc(r) shedulers Hans Schillstrom
2012-04-25  7:43 ` [PATCH 2/4] ipvs: take care of return value from protocol init_netns Hans Schillstrom
2012-04-25  8:35   ` Julian Anastasov [this message]

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=alpine.LFD.2.00.1204251126420.1895@ja.ssi.bg \
    --to=ja@ssi.bg \
    --cc=hans.schillstrom@ericsson.com \
    --cc=hans@schillstrom.com \
    --cc=horms@verge.net.au \
    --cc=lvs-devel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=wensong@linux-vs.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