All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ying Xue <ying.xue0@gmail.com>
To: Wei Yongjun <weiyj.lk@gmail.com>,
	Jon Maloy <jon.maloy@ericsson.com>,
	Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>,
	"David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net
Subject: Re: [PATCH -next] tipc: fix imbalance read_unlock_bh in __tipc_nl_add_monitor()
Date: Thu, 28 Jul 2016 17:50:13 +0800	[thread overview]
Message-ID: <5799D555.3010905@gmail.com> (raw)
In-Reply-To: <1469671669-12829-1-git-send-email-weiyj.lk@gmail.com>

On 07/28/2016 10:07 AM, Wei Yongjun wrote:
> In the error handling case of nla_nest_start() failed read_unlock_bh()
> is called  to unlock a lock that had not been taken yet. sparse warns
> about the context imbalance as the following:
> 
> net/tipc/monitor.c:799:23: warning:
>  context imbalance in '__tipc_nl_add_monitor' - different lock contexts for basic block
> 
> Fixes: cf6f7e1d5109 ('tipc: dump monitor attributes')
> Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>

Acked-by: Ying Xue <ying.xue@windriver.com>

> ---
>  net/tipc/monitor.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c
> index be70a57..b62caa1 100644
> --- a/net/tipc/monitor.c
> +++ b/net/tipc/monitor.c
> @@ -794,10 +794,10 @@ int __tipc_nl_add_monitor(struct net *net, struct tipc_nl_msg *msg,
>  	return 0;
>  
>  attr_msg_full:
> +	read_unlock_bh(&mon->lock);
>  	nla_nest_cancel(msg->skb, attrs);
>  msg_full:
>  	genlmsg_cancel(msg->skb, hdr);
> -	read_unlock_bh(&mon->lock);
>  
>  	return -EMSGSIZE;
>  }
> 
> 

  reply	other threads:[~2016-07-28  9:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-28  2:07 [PATCH -next] tipc: fix imbalance read_unlock_bh in __tipc_nl_add_monitor() Wei Yongjun
2016-07-28  9:50 ` Ying Xue [this message]
2016-07-31  3:38 ` David Miller

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=5799D555.3010905@gmail.com \
    --to=ying.xue0@gmail.com \
    --cc=davem@davemloft.net \
    --cc=jon.maloy@ericsson.com \
    --cc=netdev@vger.kernel.org \
    --cc=parthasarathy.bhuvaragan@ericsson.com \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=weiyj.lk@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.