summaryrefslogtreecommitdiff
path: root/net/smc
diff options
context:
space:
mode:
authorStefan Raspl <raspl@linux.ibm.com>2023-01-23 21:17:45 +0300
committerDavid S. Miller <davem@davemloft.net>2023-01-25 12:46:48 +0300
commitc40bff4132e5c1320635ae809d001ccb5598dac6 (patch)
tree7365fa13e18248b00b796e5c5733a23cc8aab2bc /net/smc
parentd0671115869d19ec76d658c4bf86d3211a8ea121 (diff)
downloadlinux-c40bff4132e5c1320635ae809d001ccb5598dac6.tar.xz
net/smc: Terminate connections prior to device removal
Removing an ISM device prior to terminating its associated connections doesn't end well. Signed-off-by: Stefan Raspl <raspl@linux.ibm.com> Signed-off-by: Jan Karcher <jaka@linux.ibm.com> Signed-off-by: Wenjia Zhang <wenjia@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc')
-rw-r--r--net/smc/smc_ism.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/smc/smc_ism.c b/net/smc/smc_ism.c
index 911fe08bc54b..28e1641f990c 100644
--- a/net/smc/smc_ism.c
+++ b/net/smc/smc_ism.c
@@ -462,11 +462,11 @@ void smcd_unregister_dev(struct smcd_dev *smcd)
{
pr_warn_ratelimited("smc: removing smcd device %s\n",
dev_name(&smcd->dev));
+ smcd->going_away = 1;
+ smc_smcd_terminate_all(smcd);
mutex_lock(&smcd_dev_list.mutex);
list_del_init(&smcd->list);
mutex_unlock(&smcd_dev_list.mutex);
- smcd->going_away = 1;
- smc_smcd_terminate_all(smcd);
destroy_workqueue(smcd->event_wq);
device_del(&smcd->dev);