Skip to content

Commit

Permalink
RDMA/bnxt_re: Wait for delayed work to finish before device removal
Browse files Browse the repository at this point in the history
Delayed work bnxt_re_worker would be still running even after
cancel_delayed_work returns. This causes crash as the driver proceeds with
device removal. To make sure that the work is finished before returning,
use cancel_delayed_work_sync.

Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
Selvin Xavier authored and Jason Gunthorpe committed Oct 16, 2018
1 parent 854a202 commit a08b9e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/bnxt_re/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ static void bnxt_re_ib_unreg(struct bnxt_re_dev *rdev)
bnxt_re_unregister_ib(rdev);
}
if (test_and_clear_bit(BNXT_RE_FLAG_QOS_WORK_REG, &rdev->flags))
cancel_delayed_work(&rdev->worker);
cancel_delayed_work_sync(&rdev->worker);

bnxt_re_cleanup_res(rdev);
bnxt_re_free_res(rdev);
Expand Down

0 comments on commit a08b9e9

Please sign in to comment.