netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jon.maloy@ericsson.com
Cc: netdev@vger.kernel.org,
	mohan.krishna.ghanta.krishnamurthy@ericsson.com,
	tung.q.nguyen@dektech.com.au, hoang.h.le@dektech.com.au,
	canh.d.luu@dektech.com.au, ying.xue@windriver.com,
	tipc-discussion@lists.sourceforge.net
Subject: Re: [net-next 1/4] tipc: replace name table service range array with rb tree
Date: Thu, 29 Mar 2018 14:46:42 -0400 (EDT)	[thread overview]
Message-ID: <20180329.144642.751836841871954960.davem@davemloft.net> (raw)
In-Reply-To: <1522249103-32714-2-git-send-email-jon.maloy@ericsson.com>

From: Jon Maloy <jon.maloy@ericsson.com>
Date: Wed, 28 Mar 2018 16:58:20 +0200

> -/*
> - * tipc_nametbl_publish - add name publication to network name tables
> +/* tipc_nametbl_publish - add service binding to name table
>   */
>  struct publication *tipc_nametbl_publish(struct net *net, u32 type, u32 lower,
> -					 u32 upper, u32 scope, u32 port_ref,
> +					 u32 upper, u32 scope, u32 port,
>  					 u32 key)
>  {
> -	struct publication *publ;
> -	struct sk_buff *buf = NULL;
> -	struct tipc_net *tn = net_generic(net, tipc_net_id);
> +	struct name_table *nt = tipc_name_table(net);
> +	struct tipc_net *tn = tipc_net(net);
> +	struct sk_buff *skb = NULL;
> +	struct publication *p;
>  
>  	spin_lock_bh(&tn->nametbl_lock);
> -	if (tn->nametbl->local_publ_count >= TIPC_MAX_PUBLICATIONS) {
> -		pr_warn("Publication failed, local publication limit reached (%u)\n",
> -			TIPC_MAX_PUBLICATIONS);
> -		spin_unlock_bh(&tn->nametbl_lock);
> -		return NULL;
> +
> +	if (nt->local_publ_count >= TIPC_MAX_PUBL) {
> +		pr_warn("Bind failed, max limit %u reached\n", TIPC_MAX_PUBL);
> +		goto exit;

If we goto exit:...

> +exit:
>  	spin_unlock_bh(&tn->nametbl_lock);
>  
> -	if (buf)
> -		tipc_node_broadcast(net, buf);
> -	return publ;
> +	if (skb)
> +		tipc_node_broadcast(net, skb);
> +	return p;
>  }

'p' is uninitialized, yet we return it.

  reply	other threads:[~2018-03-29 18:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 14:58 [net-next 0/4] tipc: slim down name table Jon Maloy
2018-03-28 14:58 ` [net-next 1/4] tipc: replace name table service range array with rb tree Jon Maloy
2018-03-29 18:46   ` David Miller [this message]
2018-03-28 14:58 ` [net-next 2/4] tipc: refactor name table translate function Jon Maloy
2018-03-28 14:58 ` [net-next 3/4] tipc: permit overlapping service ranges in name table Jon Maloy
2018-03-28 14:58 ` [net-next 4/4] tipc: tipc: rename address types in user api Jon Maloy

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=20180329.144642.751836841871954960.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=canh.d.luu@dektech.com.au \
    --cc=hoang.h.le@dektech.com.au \
    --cc=jon.maloy@ericsson.com \
    --cc=mohan.krishna.ghanta.krishnamurthy@ericsson.com \
    --cc=netdev@vger.kernel.org \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=tung.q.nguyen@dektech.com.au \
    --cc=ying.xue@windriver.com \
    /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).