linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for v5.6] pulse8-cec: INIT_DELAYED_WORK was called too late
@ 2020-01-24 11:53 Hans Verkuil
  0 siblings, 0 replies; only message in thread
From: Hans Verkuil @ 2020-01-24 11:53 UTC (permalink / raw)
  To: Linux Media Mailing List

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 <hans.verkuil@cisco.com>
Fixes: 601282d65b96 ("media: pulse8-cec: use adap_free callback")
---
 drivers/media/usb/pulse8-cec/pulse8-cec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/usb/pulse8-cec/pulse8-cec.c b/drivers/media/usb/pulse8-cec/pulse8-cec.c
index afda438d4e0a..8d61bcec14bb 100644
--- a/drivers/media/usb/pulse8-cec/pulse8-cec.c
+++ b/drivers/media/usb/pulse8-cec/pulse8-cec.c
@@ -840,6 +840,8 @@ static int pulse8_connect(struct serio *serio, struct serio_driver *drv)
 	serio_set_drvdata(serio, pulse8);
 	INIT_WORK(&pulse8->irq_work, pulse8_irq_work_handler);
 	INIT_WORK(&pulse8->tx_work, pulse8_tx_work_handler);
+	INIT_DELAYED_WORK(&pulse8->ping_eeprom_work,
+			  pulse8_ping_eeprom_work_handler);
 	mutex_init(&pulse8->lock);
 	spin_lock_init(&pulse8->msg_lock);
 	pulse8->config_pending = false;
@@ -865,8 +867,6 @@ static int pulse8_connect(struct serio *serio, struct serio_driver *drv)
 		pulse8->restoring_config = true;
 	}

-	INIT_DELAYED_WORK(&pulse8->ping_eeprom_work,
-			  pulse8_ping_eeprom_work_handler);
 	schedule_delayed_work(&pulse8->ping_eeprom_work, PING_PERIOD);

 	return 0;
-- 
2.23.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-24 11:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-24 11:53 [PATCH for v5.6] pulse8-cec: INIT_DELAYED_WORK was called too late Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).