--- x/net/kcm/kcmsock.c +++ y/net/kcm/kcmsock.c @@ -717,6 +717,8 @@ static void kcm_tx_work(struct work_stru lock_sock(sk); + if (kcm->tx_stopped) + goto out; /* Primarily for SOCK_DGRAM sockets, also handle asynchronous tx * aborts */ @@ -1733,6 +1735,7 @@ static int kcm_release(struct socket *so sock->sk = NULL; + flush_work(&kcm->tx_work); kcm_done(kcm); return 0;