netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2] af_unix: Fix undefined 'other' error
@ 2025-02-10  7:50 Purva Yeshi
  2025-02-10 17:50 ` Joe Damato
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Purva Yeshi @ 2025-02-10  7:50 UTC (permalink / raw)
  To: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: skhan, Simon Horman, Purva Yeshi, netdev, linux-kernel

Fix issue detected by smatch tool:
An "undefined 'other'" error occur in __releases() annotation.

Fix an undefined 'other' error in unix_wait_for_peer() caused by  
__releases(&unix_sk(other)->lock) being placed before 'other' is in  
scope. Since AF_UNIX does not use Sparse annotations, remove it to fix  
the issue.  

Eliminate the error without affecting functionality.  

Signed-off-by: Purva Yeshi <purvayeshi550@gmail.com>
---
V1 - https://lore.kernel.org/lkml/20250209184355.16257-1-purvayeshi550@gmail.com/
V2 - Remove __releases() annotation as AF_UNIX does not use Sparse annotations.
 net/unix/af_unix.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 34945de1f..319153850 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1508,7 +1508,6 @@ static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr,
 }
 
 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;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-02-18 13:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-10  7:50 [PATCH net-next v2] af_unix: Fix undefined 'other' error Purva Yeshi
2025-02-10 17:50 ` Joe Damato
2025-02-11  0:32 ` Kuniyuki Iwashima
2025-02-12 14:24   ` Purva Yeshi
2025-02-12 18:48     ` Jakub Kicinski
2025-02-13  7:44       ` Purva Yeshi
2025-02-15 17:24 ` Simon Horman
2025-02-16 19:33   ` Dan Carpenter
2025-02-17 11:15     ` Simon Horman
2025-02-17 14:14       ` Dan Carpenter
2025-02-18 13:21         ` Simon Horman
2025-02-18 13:37           ` Purva Yeshi

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).