af_unix: Add missing annotation for unix_wait_for_peer()
authorJules Irenge <jbi.octave@gmail.com>
Sun, 23 Feb 2020 23:16:56 +0000 (23:16 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Feb 2020 21:26:49 +0000 (13:26 -0800)
Sparse reports a warning unix_wait_for_peer()

warning: context imbalance in unix_wait_for_peer() - unexpected unlock

The root cause is the missing annotation at unix_wait_for_peer()
Add the missing annotation __releases(&unix_sk(other)->lock)

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/unix/af_unix.c

index 62c12cb5763e6d0ec4ef7daefd6836b6588b7185..cbd7dc01e147040e3691f3ab5c174ee370adccfa 100644 (file)
@@ -1207,6 +1207,7 @@ out:
 }
 
 static long unix_wait_for_peer(struct sock *other, long timeo)
+       __releases(&unix_sk(other)->lock)
 {
        struct unix_sock *u = unix_sk(other);
        int sched;