media: saa7164: WARN_ON in __queue_work() on early IRQ
From: Jaeyoung Chung
Date: Wed Jun 10 2026 - 07:41:11 EST
Hi,
saa7164_initdev() in drivers/media/pci/saa7164/saa7164-core.c registers
the interrupt handler saa7164_irq() with request_irq() before it
initializes dev->workcmd with INIT_WORK(). If an interrupt arrives
between request_irq() and INIT_WORK(), saa7164_irq() calls
schedule_work() on the uninitialized work item, which triggers a
kernel warning.
The probe path, in saa7164_initdev():
dev = kzalloc_obj(*dev); /* dev->workcmd zeroed */
...
err = request_irq(pci_dev->irq, saa7164_irq, ...); /* register handler */
...
INIT_WORK(&dev->workcmd, saa7164_work_cmdhandler); /* initialize work item */
The interrupt handler, saa7164_irq(), schedules the work item:
schedule_work(&dev->workcmd);
If the device raises an interrupt before INIT_WORK() runs, the handler
schedules the uninitialized work item, which triggers
WARN_ON(!list_empty(&work->entry)) in __queue_work().
Suggested fix: move INIT_WORK(&dev->workcmd, saa7164_work_cmdhandler)
above the request_irq() calls, so the work item is valid before the
handler can run.
Reported-by: Sangyun Kim <sangyun.kim@xxxxxxxxx>
Reported-by: Kyungwook Boo <bookyungwook@xxxxxxxxx>
Thanks,
Jaeyoung Chung