Subject: Re: [PATCH] stmmac: Clear variable when destroying workqueue

From: Jakub Kicinski <[email-masked]>
Date: Fri, 23 Feb 2024 16:32:51 -0800

On Wed, 21 Feb 2024 15:32:33 +0100 Jakub Raczynski wrote:
> Currently when suspending driver and stopping workqueue it is checked whether
> workqueue is not NULL and if so, it is destroyed.
> Function destroy_workqueue() does drain queue and does clear variable, but
> it does not set workqueue variable to NULL. This can cause kernel/module
> panic if code attempts to clear workqueue that was not initialized.

Is there no risk that we'll try to queue_work() on the uninitialized
workqueue?  I wonder if we should also set __FPE_REMOVING when the
queue allocation fails, just to make sure we never try to queue?

Please repost with a Fixes tag added (pointing to oldest commit where
the problem may happen), and with [PATCH net v2] as the subject tag.
-- 
pw-bot: cr