In the Linux kernel, the following vulnerability has been resolved:
scsi: mpi3mr: Fix use-after-free of the firmware event workqueue
The enqueue path reads the workqueue pointer before taking the event lock,
while the remove path clears that pointer and destroys the workqueue while
holding it. The enqueue can therefore reach queue_work() after the
workqueue is gone.
Move the check inside the lock.