Skip to content

Commit 34a8188

Browse files
Hans Verkuilmchehab
authored andcommitted
media: pulse8-cec: INIT_DELAYED_WORK was called too late
If earlier in the connect() an error occurred, then pulse8_cec_adap_free was called by cec_delete_adapter, and that free function tried to cancel the ping_eeprom_work workqueue, but that workqueue hasn't been initialized yet, resulting in a kernel warning. Move the initialization of that workqueue up to where the other workqueues are initialized. Signed-off-by: Hans Verkuil <[email protected]> Fixes: 601282d ("media: pulse8-cec: use adap_free callback") Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent bb6d3fb commit 34a8188

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/media/usb/pulse8-cec/pulse8-cec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,8 @@ static int pulse8_connect(struct serio *serio, struct serio_driver *drv)
840840
serio_set_drvdata(serio, pulse8);
841841
INIT_WORK(&pulse8->irq_work, pulse8_irq_work_handler);
842842
INIT_WORK(&pulse8->tx_work, pulse8_tx_work_handler);
843+
INIT_DELAYED_WORK(&pulse8->ping_eeprom_work,
844+
pulse8_ping_eeprom_work_handler);
843845
mutex_init(&pulse8->lock);
844846
spin_lock_init(&pulse8->msg_lock);
845847
pulse8->config_pending = false;
@@ -865,8 +867,6 @@ static int pulse8_connect(struct serio *serio, struct serio_driver *drv)
865867
pulse8->restoring_config = true;
866868
}
867869

868-
INIT_DELAYED_WORK(&pulse8->ping_eeprom_work,
869-
pulse8_ping_eeprom_work_handler);
870870
schedule_delayed_work(&pulse8->ping_eeprom_work, PING_PERIOD);
871871

872872
return 0;

0 commit comments

Comments
 (0)