Skip to content

Commit

Permalink
net: smc: fix spurious error message from __sock_release()
Browse files Browse the repository at this point in the history
Commit 67f562e ("net/smc: transfer fasync_list in case of fallback")
leaves the socket's fasync list pointer within a container socket as well.
When the latter is destroyed, '__sock_release()' warns about its non-empty
fasync list, which is a dangling pointer to previously freed fasync list
of an underlying TCP socket. Fix this spurious warning by nullifying
fasync list of a container socket.

Fixes: 67f562e ("net/smc: transfer fasync_list in case of fallback")
Signed-off-by: Dmitry Antipov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
dmantipov authored and davem330 committed Feb 14, 2024
1 parent d9a31cd commit 6cf9ff4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/smc/af_smc.c
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ static int smc_switch_to_fallback(struct smc_sock *smc, int reason_code)
smc->clcsock->file->private_data = smc->clcsock;
smc->clcsock->wq.fasync_list =
smc->sk.sk_socket->wq.fasync_list;
smc->sk.sk_socket->wq.fasync_list = NULL;

/* There might be some wait entries remaining
* in smc sk->sk_wq and they should be woken up
Expand Down

0 comments on commit 6cf9ff4

Please sign in to comment.