Thread (1 message) 1 message, 1 author, 2020-02-14
STALE2374d

[PATCH 24/30] tipc: Add missing annotation for tipc_node_read_lock()

From: Jules Irenge <hidden>
Date: 2020-02-14 20:49:54
Also in: lkml
Subsystem: networking [general], the rest, tipc network layer · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds, Jon Maloy, Tung Quang Nguyen

Sparse reports a warning at tipc_node_read_lock()

warning: context imbalance in  tipc_node_read_lock - wrong count at exit

The root cause is the missing annotation at tipc_node_read_lock()
Add the missing __acquires(&n->lock) annotattion

Signed-off-by: Jules Irenge <redacted>
---
 net/tipc/node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 99b28b69fc17..4e267ed94a2a 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -351,7 +351,7 @@ static struct tipc_node *tipc_node_find_by_id(struct net *net, u8 *id)
 	return found ? n : NULL;
 }
 
-static void tipc_node_read_lock(struct tipc_node *n)
+static void tipc_node_read_lock(struct tipc_node *n) __acquires(&n->lock)
 {
 	read_lock_bh(&n->lock);
 }
-- 
2.24.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help