]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iavf: initialize waitqueues before starting watchdog_task
authorMichal Schmidt <mschmidt@redhat.com>
Thu, 19 Oct 2023 07:13:46 +0000 (09:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Nov 2023 08:35:26 +0000 (09:35 +0100)
commitd8ac13acfbf79cc1febf50aa0b5fd2ebc21136a3
tree1f410f52de33fd4b089b763687d560fdbc1fd73b
parent66e879507b12299b615ab066a6e9583d53323cb3
iavf: initialize waitqueues before starting watchdog_task

[ Upstream commit 7db3111043885c146e795c199d39c3f9042d97c0 ]

It is not safe to initialize the waitqueues after queueing the
watchdog_task. It will be using them.

The chance of this causing a real problem is very small, because
there will be some sleeping before any of the waitqueues get used.
I got a crash only after inserting an artificial sleep in iavf_probe.

Queue the watchdog_task as the last step in iavf_probe. Add a comment to
prevent repeating the mistake.

Fixes: fe2647ab0c99 ("i40evf: prevent VF close returning before state transitions to DOWN")
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/iavf/iavf_main.c