Memset the spi tx buffer under lock in knc driver.
diff --git a/driver-knc-spi-fpga.c b/driver-knc-spi-fpga.c
index 21745c7..d47e842 100644
--- a/driver-knc-spi-fpga.c
+++ b/driver-knc-spi-fpga.c
@@ -789,11 +789,11 @@ static int64_t knc_scanwork(struct thr_info *thr)
knc_check_disabled_cores(knc);
- /* Prepare tx buffer */
- memset(spi_txbuf, 0, sizeof(spi_txbuf));
num = 0;
mutex_lock(&knc->lock);
+ /* Prepare tx buffer */
+ memset(spi_txbuf, 0, sizeof(spi_txbuf));
next_read_q = knc->read_q;
knc_queued_fifo_inc_idx(&next_read_q);