net/smc: check connections in smc_lgr_free_work

Remove the shortcut that smc_lgr_free() would skip the check for
existing connections when the link group is not in the link group list.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Karsten Graul 2019-02-12 16:29:54 +01:00 committed by David S. Miller
parent cf0cfe5358
commit e78b262226
1 changed files with 2 additions and 4 deletions

View File

@ -160,8 +160,6 @@ static void smc_lgr_free_work(struct work_struct *work)
bool conns; bool conns;
spin_lock_bh(&smc_lgr_list.lock); spin_lock_bh(&smc_lgr_list.lock);
if (list_empty(&lgr->list))
goto free;
read_lock_bh(&lgr->conns_lock); read_lock_bh(&lgr->conns_lock);
conns = RB_EMPTY_ROOT(&lgr->conns_all); conns = RB_EMPTY_ROOT(&lgr->conns_all);
read_unlock_bh(&lgr->conns_lock); read_unlock_bh(&lgr->conns_lock);
@ -169,8 +167,8 @@ static void smc_lgr_free_work(struct work_struct *work)
spin_unlock_bh(&smc_lgr_list.lock); spin_unlock_bh(&smc_lgr_list.lock);
return; return;
} }
list_del_init(&lgr->list); /* remove from smc_lgr_list */ if (!list_empty(&lgr->list))
free: list_del_init(&lgr->list); /* remove from smc_lgr_list */
spin_unlock_bh(&smc_lgr_list.lock); spin_unlock_bh(&smc_lgr_list.lock);
if (!lgr->is_smcd && !lgr->terminating) { if (!lgr->is_smcd && !lgr->terminating) {