Commit 6cf9ff46 authored by Dmitry Antipov's avatar Dmitry Antipov Committed by David S. Miller

net: smc: fix spurious error message from __sock_release()

Commit 67f562e3 ("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: 67f562e3 ("net/smc: transfer fasync_list in case of fallback")
Signed-off-by: default avatarDmitry Antipov <dmantipov@yandex.ru>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d9a31cda
...@@ -924,6 +924,7 @@ static int smc_switch_to_fallback(struct smc_sock *smc, int reason_code) ...@@ -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->file->private_data = smc->clcsock;
smc->clcsock->wq.fasync_list = smc->clcsock->wq.fasync_list =
smc->sk.sk_socket->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 /* There might be some wait entries remaining
* in smc sk->sk_wq and they should be woken up * in smc sk->sk_wq and they should be woken up
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment