diff options
author | Stefan Wahren <wahrenst@gmx.net> | 2024-01-28 21:10:45 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-01-31 14:38:50 +0100 |
commit | c494a01abe01fcfcbbcd849023ce06a573963aed (patch) | |
tree | db5caca34ea4f959947b58836ea9b0535bd9d27f /drivers | |
parent | net: lan966x: debugfs: Fix showing the port keyset (diff) | |
download | linux-c494a01abe01fcfcbbcd849023ce06a573963aed.tar.xz linux-c494a01abe01fcfcbbcd849023ce06a573963aed.zip |
qca_spi: Add check for kthread_stop
We better not rely on that spi_thread points to a running
thread. So add an check for this.
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/qualcomm/qca_spi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c index 5f3c11fb3fa2..77bab8bf5203 100644 --- a/drivers/net/ethernet/qualcomm/qca_spi.c +++ b/drivers/net/ethernet/qualcomm/qca_spi.c @@ -730,8 +730,10 @@ qcaspi_netdev_close(struct net_device *dev) qcaspi_write_register(qca, SPI_REG_INTR_ENABLE, 0, wr_verify); free_irq(qca->spi_dev->irq, qca); - kthread_stop(qca->spi_thread); - qca->spi_thread = NULL; + if (qca->spi_thread) { + kthread_stop(qca->spi_thread); + qca->spi_thread = NULL; + } qcaspi_flush_tx_ring(qca); return 0; |