Commit ff8ce319 authored by Chuhong Yuan's avatar Chuhong Yuan Committed by David S. Miller

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: default avatarChuhong Yuan <hslester96@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 09454fd0
...@@ -1070,7 +1070,7 @@ static int encx24j600_spi_probe(struct spi_device *spi) ...@@ -1070,7 +1070,7 @@ static int encx24j600_spi_probe(struct spi_device *spi)
if (unlikely(ret)) { if (unlikely(ret)) {
netif_err(priv, probe, ndev, "Error %d initializing card encx24j600 card\n", netif_err(priv, probe, ndev, "Error %d initializing card encx24j600 card\n",
ret); ret);
goto out_free; goto out_stop;
} }
eidled = encx24j600_read_reg(priv, EIDLED); eidled = encx24j600_read_reg(priv, EIDLED);
...@@ -1088,6 +1088,8 @@ static int encx24j600_spi_probe(struct spi_device *spi) ...@@ -1088,6 +1088,8 @@ static int encx24j600_spi_probe(struct spi_device *spi)
out_unregister: out_unregister:
unregister_netdev(priv->ndev); unregister_netdev(priv->ndev);
out_stop:
kthread_stop(priv->kworker_task);
out_free: out_free:
free_netdev(ndev); free_netdev(ndev);
...@@ -1100,6 +1102,7 @@ static int encx24j600_spi_remove(struct spi_device *spi) ...@@ -1100,6 +1102,7 @@ static int encx24j600_spi_remove(struct spi_device *spi)
struct encx24j600_priv *priv = dev_get_drvdata(&spi->dev); struct encx24j600_priv *priv = dev_get_drvdata(&spi->dev);
unregister_netdev(priv->ndev); unregister_netdev(priv->ndev);
kthread_stop(priv->kworker_task);
free_netdev(priv->ndev); free_netdev(priv->ndev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment