On 15/10/2024 13:04, Dan Carpenter wrote: > Hello Samuel Ortiz, > > Commit d646960f7986 ("NFC: Initial LLCP support") from Dec 14, 2011 > (linux-next), leads to the following Smatch static checker warning: > > net/nfc/llcp_core.c:1147 nfc_llcp_recv_hdlc() > warn: double unlock 'sk' (orig line 1088) > > net/nfc/llcp_core.c > 1064 static void nfc_llcp_recv_hdlc(struct nfc_llcp_local *local, > 1065 struct sk_buff *skb) > 1066 { > 1067 struct nfc_llcp_sock *llcp_sock; > 1068 struct sock *sk; > 1069 u8 dsap, ssap, ptype, ns, nr; > 1070 > 1071 ptype = nfc_llcp_ptype(skb); > 1072 dsap = nfc_llcp_dsap(skb); > 1073 ssap = nfc_llcp_ssap(skb); > 1074 ns = nfc_llcp_ns(skb); > 1075 nr = nfc_llcp_nr(skb); > 1076 > 1077 pr_debug("%d %d R %d S %d\n", dsap, ssap, nr, ns); > 1078 > 1079 llcp_sock = nfc_llcp_sock_get(local, dsap, ssap); > 1080 if (llcp_sock == NULL) { > 1081 nfc_llcp_send_dm(local, dsap, ssap, LLCP_DM_NOCONN); > 1082 return; > 1083 } > 1084 > 1085 sk = &llcp_sock->sk; > 1086 lock_sock(sk); > 1087 if (sk->sk_state == LLCP_CLOSED) { > 1088 release_sock(sk); > 1089 nfc_llcp_sock_put(llcp_sock); > > Sorry, to bother you after 15 years, but hopefully this question is easy. Was > there supposed to be a return; after the nfc_llcp_sock_put()? Similar pattern in nfc_llcp_recv_disc(). Yeah, I am pretty sure this should return here. Best regards, Krzysztof