[PATCH AUTOSEL 4.19 24/44] Input: ps2-gpio - flush TX work when closing port

From: Sasha Levin
Date: Mon Mar 11 2019 - 16:07:02 EST


From: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>

[ Upstream commit 33a841ce5cef4ca6c18ad333248b6d273f54c839 ]

To ensure that TX work is not running after serio port has been torn down,
let's flush it when closing the port.

Reported-by: Sven Van Asbroeck <thesven73@xxxxxxxxx>
Acked-by: Danilo Krummrich <danilokrummrich@xxxxxxxxxxxxx>
Reviewed-by: Sven Van Asbroeck <TheSven73@xxxxxxxxx>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/input/serio/ps2-gpio.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/input/serio/ps2-gpio.c b/drivers/input/serio/ps2-gpio.c
index c62cceb97bb1..5e8d8384aa2a 100644
--- a/drivers/input/serio/ps2-gpio.c
+++ b/drivers/input/serio/ps2-gpio.c
@@ -76,6 +76,7 @@ static void ps2_gpio_close(struct serio *serio)
{
struct ps2_gpio_data *drvdata = serio->port_data;

+ flush_delayed_work(&drvdata->tx_work);
disable_irq(drvdata->irq);
}

--
2.19.1