]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/smc: cancel event worker during device removal
authorKarsten Graul <kgraul@linux.ibm.com>
Tue, 10 Mar 2020 08:33:30 +0000 (09:33 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 10 Mar 2020 22:40:33 +0000 (15:40 -0700)
During IB device removal, cancel the event worker before the device
structure is freed.

Fixes: 0bb7e7b2f4d9 ("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>
net/smc/smc_ib.c

index d6ba186f67e2aa16d8f3822bea0950f0cb6612cc..05b825b3cfa4861cd0ab24b4ac9ad4476a75aabf 100644 (file)
@@ -582,6 +582,7 @@ static void smc_ib_remove_dev(struct ib_device *ibdev, void *client_data)
        smc_smcr_terminate_all(smcibdev);
        smc_ib_cleanup_per_ibdev(smcibdev);
        ib_unregister_event_handler(&smcibdev->event_handler);
+       cancel_work_sync(&smcibdev->port_event_work);
        kfree(smcibdev);
 }