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

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
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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);

	if (qca->spi_thread) {
		kthread_stop(qca->spi_thread);
		qca->spi_thread = NULL;
	}
	qcaspi_flush_tx_ring(qca);

	return 0;