Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 427c63e1 authored by Chuhong Yuan's avatar Chuhong Yuan Committed by Greg Kroah-Hartman
Browse files

net: microchip: encx24j600: add missed kthread_stop



[ Upstream commit ff8ce319e9c25e920d994cc35236f0bb32dfc8f3 ]

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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 60df5e03
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1075,7 +1075,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);
@@ -1093,6 +1093,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);

@@ -1105,6 +1107,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);