Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 268ffcc4 authored by Ursula Braun's avatar Ursula Braun Committed by David S. Miller
Browse files

net/smc: free link group without pending free_work only



Make sure there is no pending or running free_work worker for the link
group when freeing the link group.

Signed-off-by: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c9f4c6cf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1477,6 +1477,7 @@ static void __exit smc_exit(void)
	spin_unlock_bh(&smc_lgr_list.lock);
	list_for_each_entry_safe(lgr, lg, &lgr_freeing_list, list) {
		list_del_init(&lgr->list);
		cancel_delayed_work_sync(&lgr->free_work);
		smc_lgr_free(lgr); /* free link group */
	}
	static_branch_disable(&tcp_have_smc);
+2 −1
Original line number Diff line number Diff line
@@ -140,6 +140,7 @@ static void smc_lgr_free_work(struct work_struct *work)
	list_del_init(&lgr->list); /* remove from smc_lgr_list */
free:
	spin_unlock_bh(&smc_lgr_list.lock);
	if (!delayed_work_pending(&lgr->free_work))
		smc_lgr_free(lgr);
}