]> git.baikalelectronics.ru Git - kernel.git/commit
qed: Fix race condition between scheduling and destroying the slowpath workqueue
authorYuval Basson <ybason@marvell.com>
Wed, 25 Mar 2020 20:50:43 +0000 (22:50 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 30 Mar 2020 04:50:17 +0000 (21:50 -0700)
commit79ff1bbb97f666fba4d57f6f94f9caa3cf842f4f
tree42f2fd37cba5c75362538ae91df1283538a8ae4f
parentc6496f4011906a4f0809753027ca350f00f4a802
qed: Fix race condition between scheduling and destroying the slowpath workqueue

Calling queue_delayed_work concurrently with
destroy_workqueue might race to an unexpected outcome -
scheduled task after wq is destroyed or other resources
(like ptt_pool) are freed (yields NULL pointer dereference).
cancel_delayed_work prevents the race by cancelling
the timer triggered for scheduling a new task.

Fixes: ea6af2169 ("qed: Add driver infrastucture for handling mfw requests")
Signed-off-by: Denis Bolotin <dbolotin@marvell.com>
Signed-off-by: Michal Kalderon <mkalderon@marvell.com>
Signed-off-by: Yuval Basson <ybason@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_main.c