summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Graul <kgraul@linux.ibm.com>2020-03-10 09:33:30 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-03-18 07:14:25 +0100
commit2f3121f6e2a560860bce0531721b22258ce265f3 (patch)
treefb8cafb638f4bfca0ee57d6ca7ceab0026df58ce
parenta22af440349cfa38243ef50c915e0a5a4de59702 (diff)
downloadlinux-stable-2f3121f6e2a560860bce0531721b22258ce265f3.tar.gz
linux-stable-2f3121f6e2a560860bce0531721b22258ce265f3.tar.bz2
linux-stable-2f3121f6e2a560860bce0531721b22258ce265f3.zip
net/smc: cancel event worker during device removal
commit ece0d7bd74615773268475b6b64d6f1ebbd4b4c6 upstream. During IB device removal, cancel the event worker before the device structure is freed. Fixes: a4cf0443c414 ("smc: introduce SMC as an IB-client") Reported-by: syzbot+b297c6825752e7a07272@syzkaller.appspotmail.com Signed-off-by: Karsten Graul <kgraul@linux.ibm.com> Reviewed-by: Ursula Braun <ubraun@linux.ibm.com> Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/smc/smc_ib.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/smc/smc_ib.c b/net/smc/smc_ib.c
index ca505ff5b5bb..c974d7d9a2bb 100644
--- a/net/smc/smc_ib.c
+++ b/net/smc/smc_ib.c
@@ -561,6 +561,7 @@ static void smc_ib_remove_dev(struct ib_device *ibdev, void *client_data)
smc_pnet_remove_by_ibdev(smcibdev);
smc_ib_cleanup_per_ibdev(smcibdev);
ib_unregister_event_handler(&smcibdev->event_handler);
+ cancel_work_sync(&smcibdev->port_event_work);
kfree(smcibdev);
}