return early if work is cancelled before being scheduled
authorjsg <jsg@openbsd.org>
Mon, 17 May 2021 00:17:26 +0000 (00:17 +0000)
committerjsg <jsg@openbsd.org>
Mon, 17 May 2021 00:17:26 +0000 (00:17 +0000)
commiteb5a2f7a863ce9d301051106a3ca09d316faa190
tree84fba1bfb4292a85c685a602b1416dd438202100
parentd40696423e65f3592ae96f1ff23079c935bde5f1
return early if work is cancelled before being scheduled

cheloha@ noticed that task_del(9) was being called with a NULL taskq
from inteldrm(4), which was not noticed as the function returns early
from testing a flag in the task.  This situation occurs when work is
cancelled before it is scheduled.

ok kettenis@ cheloha@
sys/dev/pci/drm/include/linux/workqueue.h