Commit 82b29ee
spi: Add check for 8-bit transfer with 8 IO mode support
commit 7105052 upstream.
The current SPI framework does not verify if the SPI device supports
8 IO mode when doing an 8-bit transfer. This patch adds a check to
ensure that if the transfer tx_nbits or rx_nbits is 8, the SPI mode must
support 8 IO. If not, an error is returned, preventing undefined behavior.
Fixes: d6a711a ("spi: Fix OCTAL mode support")
Cc: stable@vger.kernel.org
Signed-off-by: Cheng Ming Lin <chengminglin@mxic.com.tw>
Link: https://patch.msgid.link/20250714031023.504752-1-linchengming884@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 415d496 commit 82b29ee
1 file changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4011 | 4011 | | |
4012 | 4012 | | |
4013 | 4013 | | |
4014 | | - | |
| 4014 | + | |
4015 | 4015 | | |
4016 | 4016 | | |
4017 | | - | |
| 4017 | + | |
| 4018 | + | |
| 4019 | + | |
| 4020 | + | |
4018 | 4021 | | |
4019 | 4022 | | |
4020 | 4023 | | |
| |||
4027 | 4030 | | |
4028 | 4031 | | |
4029 | 4032 | | |
4030 | | - | |
| 4033 | + | |
4031 | 4034 | | |
4032 | 4035 | | |
4033 | | - | |
| 4036 | + | |
| 4037 | + | |
| 4038 | + | |
| 4039 | + | |
4034 | 4040 | | |
4035 | 4041 | | |
4036 | 4042 | | |
| |||
0 commit comments