net: microchip: encx24j600: add missed kthread_stop
Subsystems (2)
PATCH 1/1 net: microchip: encx24j600: add missed kthread_stop
This driver calls kthread_run() in probe, but forgets to call kthread_stop() in probe failure and remove.
Add the missed kthread_stop() to fix it.
Signed-off-by Chuhong Yuan <[email protected]>
--- drivers/net/ethernet/microchip/encx24j600.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/microchip/encx24j600.c +4 -1
@@ -1070,7 +1070,7 @@ static int encx24j600_spi_probe(struct spi_device *spi)if (unlikely (ret)) {netif_err (priv, probe, ndev,"Error %d initializing card encx24j600 card\n" , ret); - goto out_free; + goto out_stop; } eidled =encx24j600_read_reg (priv,EIDLED );
@@ -1088,6 +1088,8 @@ static int encx24j600_spi_probe(struct spi_device *spi) out_unregister:unregister_netdev (priv->ndev); +out_stop: +kthread_stop (priv->kworker_task); out_free:free_netdev (ndev);
@@ -1100,6 +1102,7 @@ static int encx24j600_spi_remove(struct spi_device *spi)struct encx24j600_priv *priv =dev_get_drvdata (&spi->dev);unregister_netdev (priv->ndev); +kthread_stop (priv->kworker_task);free_netdev (priv->ndev);
Signature · 1 line
2.26.2
From: Chuhong Yuan <[email protected]>
Date: Thu, 7 May 2020 23:13:20 +0800
Quoted 5 lines
This driver calls
kthread_run()in probe, but forgets to callkthread_stop()in probe failure and remove.
Add the missedkthread_stop()to fix it.Signed-off-by Chuhong Yuan <[email protected]>
Applied, thanks.