* [PATCH] net: microchip: encx24j600: add missed kthread_stop
@ 2020-05-07 15:13 Chuhong Yuan
2020-05-08 1:09 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Chuhong Yuan @ 2020-05-07 15:13 UTC (permalink / raw)
Cc: David S . Miller, netdev, linux-kernel, Chuhong Yuan
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 <hslester96@gmail.com>
---
drivers/net/ethernet/microchip/encx24j600.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/microchip/encx24j600.c b/drivers/net/ethernet/microchip/encx24j600.c
index 39925e4bf2ec..b25a13da900a 100644
--- a/drivers/net/ethernet/microchip/encx24j600.c
+++ b/drivers/net/ethernet/microchip/encx24j600.c
@@ -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);
--
2.26.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] net: microchip: encx24j600: add missed kthread_stop
2020-05-07 15:13 [PATCH] net: microchip: encx24j600: add missed kthread_stop Chuhong Yuan
@ 2020-05-08 1:09 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-08 1:09 UTC (permalink / raw)
To: hslester96; +Cc: netdev, linux-kernel
From: Chuhong Yuan <hslester96@gmail.com>
Date: Thu, 7 May 2020 23:13:20 +0800
> 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 <hslester96@gmail.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-08 1:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 15:13 [PATCH] net: microchip: encx24j600: add missed kthread_stop Chuhong Yuan
2020-05-08 1:09 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®