From 4e3f77d884d4e996fad6fb4dc231911f248b30a4 Mon Sep 17 00:00:00 2001 From: zhangkai25 Date: Tue, 2 Jul 2024 10:21:34 +0800 Subject: [PATCH] Fixed the problem of memory trampling caused by not initializing the structure Signed-off-by: zhangkai25 --- system/spi/spi_exch.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/system/spi/spi_exch.c b/system/spi/spi_exch.c index 1a898484eb8..f229bf238c3 100644 --- a/system/spi/spi_exch.c +++ b/system/spi/spi_exch.c @@ -169,6 +169,9 @@ int spicmd_exch(FAR struct spitool_s *spitool, int argc, FAR char **argv) trans.nwords = spitool->count; trans.txbuffer = txdata; trans.rxbuffer = rxdata; +#ifdef CONFIG_SPI_HWFEATURES + trans.hwfeat = 0; +#endif ret = spidev_transfer(fd, &seq);