summaryrefslogtreecommitdiff
path: root/net/smc/smc_core.c
diff options
context:
space:
mode:
authorUrsula Braun <ubraun@linux.vnet.ibm.com>2018-01-26 09:28:48 +0100
committerDavid S. Miller <davem@davemloft.net>2018-01-26 10:41:56 -0500
commit51f1de79ad8ed3555fd01ae8fd432691d397684b (patch)
tree5f4563da79255237cd7993de320596c236ef824d /net/smc/smc_core.c
parent8dce2786a2905e5b0ce49263910b4a47af75b752 (diff)
net/smc: replace sock_put worker by socket refcounting
Proper socket refcounting makes the sock_put worker obsolete. Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_core.c')
-rw-r--r--net/smc/smc_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c
index ed5b46d1fe41..2424c7100aaf 100644
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -328,13 +328,13 @@ void smc_lgr_terminate(struct smc_link_group *lgr)
while (node) {
conn = rb_entry(node, struct smc_connection, alert_node);
smc = container_of(conn, struct smc_sock, conn);
- sock_hold(&smc->sk);
+ sock_hold(&smc->sk); /* sock_put in close work */
conn->local_tx_ctrl.conn_state_flags.peer_conn_abort = 1;
__smc_lgr_unregister_conn(conn);
write_unlock_bh(&lgr->conns_lock);
- schedule_work(&conn->close_work);
+ if (!schedule_work(&conn->close_work))
+ sock_put(&smc->sk);
write_lock_bh(&lgr->conns_lock);
- sock_put(&smc->sk);
node = rb_first(&lgr->conns_all);
}
write_unlock_bh(&lgr->conns_lock);