bnxt_en: Fix NULL ptr dereference crash in bnxt_fw_reset_task()
authorVasundhara Volam <vasundhara-v.volam@broadcom.com>
Sun, 6 Sep 2020 02:55:37 +0000 (22:55 -0400)
committerJakub Kicinski <kuba@kernel.org>
Mon, 7 Sep 2020 17:08:18 +0000 (10:08 -0700)
commitb16939b59cc00231a75d224fd058d22c9d064976
tree959d2016bd5ee4367234c2549cac2eecf5d586d5
parentb340dc680ed48dcc05b56e1ebe1b9535813c3ee0
bnxt_en: Fix NULL ptr dereference crash in bnxt_fw_reset_task()

bnxt_fw_reset_task() which runs from a workqueue can race with
bnxt_remove_one().  For example, if firmware reset and VF FLR are
happening at about the same time.

bnxt_remove_one() already cancels the workqueue and waits for it
to finish, but we need to do this earlier before the devlink
reporters are destroyed.  This will guarantee that
the devlink reporters will always be valid when bnxt_fw_reset_task()
is still running.

Fixes: b148bb238c02 ("bnxt_en: Fix possible crash in bnxt_fw_reset_task().")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c