Commit 827ba15fb6fa439b0ac21294215db5ef6dc0abaa

Con Kolivas 2013-12-23T15:35:45

Memset the spi tx buffer under lock in knc driver.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);