Commit c494a01a authored by Stefan Wahren's avatar Stefan Wahren Committed by David S. Miller

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: default avatarStefan Wahren <wahrenst@gmx.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e746094b
......@@ -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;
......
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