aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorWei Yongjun <weiyj.lk@gmail.com>2016-07-27 22:07:49 -0400
committerDavid S. Miller <davem@davemloft.net>2016-07-30 23:38:22 -0400
commit6b65bc29721dee21e963cde3a83369bd09ba5358 (patch)
treec82fcc4dbbc212910b1a833abb7a1f69c472afd7 /net
parent9d594b395808accfaafa9b572e2716e037274c2a (diff)
tipc: fix imbalance read_unlock_bh in __tipc_nl_add_monitor()
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/tipc/monitor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c
index be70a57c1ff9..b62caa1c770c 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,
794 return 0; 794 return 0;
795 795
796attr_msg_full: 796attr_msg_full:
797 read_unlock_bh(&mon->lock);
797 nla_nest_cancel(msg->skb, attrs); 798 nla_nest_cancel(msg->skb, attrs);
798msg_full: 799msg_full:
799 genlmsg_cancel(msg->skb, hdr); 800 genlmsg_cancel(msg->skb, hdr);
800 read_unlock_bh(&mon->lock);
801 801
802 return -EMSGSIZE; 802 return -EMSGSIZE;
803} 803}