--- a/net/nfc/llcp_sock.c +++ b/net/nfc/llcp_sock.c @@ -798,6 +798,10 @@ static int llcp_sock_sendmsg(struct sock return -EINVAL; } + if (llcp_sock->dev == NULL) { + release_sock(sk); + return -EBADFD; + } release_sock(sk); return nfc_llcp_send_ui_frame(llcp_sock, addr->dsap, addr->ssap,