diff options
author | Selvin Xavier <selvin.xavier@broadcom.com> | 2018-02-16 08:20:12 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2018-02-20 19:57:21 +0300 |
commit | dcdaba08062b4726500b9456f8664bfda896c664 (patch) | |
tree | 77bdeb1e050fdc1a6e54a2bc765838336c3a5df2 /drivers/infiniband/hw/bnxt_re | |
parent | 3b921e3bc4c20af58a663ed238ad57e87493dde2 (diff) | |
download | linux-dcdaba08062b4726500b9456f8664bfda896c664.tar.xz |
RDMA/bnxt_re: Fix system crash during load/unload
During driver unload, the driver proceeds with cleanup
without waiting for the scheduled events. So the device
pointers get freed up and driver crashes when the events
are scheduled later.
Flush the bnxt_re_task work queue before starting
device removal.
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/bnxt_re')
-rw-r--r-- | drivers/infiniband/hw/bnxt_re/main.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index 508d00a5a106..7f9298db507b 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -1578,6 +1578,11 @@ static void __exit bnxt_re_mod_exit(void) */ list_for_each_entry_safe_reverse(rdev, next, &to_be_deleted, list) { dev_info(rdev_to_dev(rdev), "Unregistering Device"); + /* + * Flush out any scheduled tasks before destroying the + * resources + */ + flush_workqueue(bnxt_re_wq); bnxt_re_dev_stop(rdev); bnxt_re_ib_unreg(rdev, true); bnxt_re_remove_one(rdev); |