aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTian Tao <[email protected]>2021-04-29 19:20:48 +0800
committerMark Brown <[email protected]>2021-05-10 13:17:17 +0100
commite7a1a3abea373e41ba7dfe0fbc93cb79b6a3a529 (patch)
tree4d05da78f9eecbe8cbe1f4ece52a85e544c2a638
parent029d32a892a860017d33ff8d9598259731e776ad (diff)
spi: omap-100k: Fix the length judgment problem
word_len should be checked in the omap1_spi100k_setup_transfer function to see if it exceeds 32. Signed-off-by: Tian Tao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--drivers/spi/spi-omap-100k.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c
index 7062f2902253..f104470605b3 100644
--- a/drivers/spi/spi-omap-100k.c
+++ b/drivers/spi/spi-omap-100k.c
@@ -241,7 +241,7 @@ static int omap1_spi100k_setup_transfer(struct spi_device *spi,
else
word_len = spi->bits_per_word;
- if (spi->bits_per_word > 32)
+ if (word_len > 32)
return -EINVAL;
cs->word_len = word_len;