Skip to content

Commit

Permalink
net: microchip: encx24j600: add missed kthread_stop
Browse files Browse the repository at this point in the history
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]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
WillLester authored and davem330 committed May 8, 2020
1 parent 09454fd commit ff8ce31
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/ethernet/microchip/encx24j600.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);

Expand All @@ -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);

Expand Down

0 comments on commit ff8ce31

Please sign in to comment.