summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTian Tao <tiantao6@hisilicon.com>2021-04-29 19:20:48 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-20 16:22:31 +0200
commit59a05d64398f51c4e9d3ddf34d0cf71a1a98e125 (patch)
tree6978a7eeb84f9d363e6adeb616866fc6f85f86ba /drivers
parent0a82857600820c4907cccffff648d71ad50dd48e (diff)
spi: omap-100k: Fix the length judgment problem
[ Upstream commit e7a1a3abea373e41ba7dfe0fbc93cb79b6a3a529 ] word_len should be checked in the omap1_spi100k_setup_transfer function to see if it exceeds 32. Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Link: https://lore.kernel.org/r/1619695248-39045-1-git-send-email-tiantao6@hisilicon.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-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 1eccdc4a4581..2eeb0fe2eed2 100644
--- a/drivers/spi/spi-omap-100k.c
+++ b/drivers/spi/spi-omap-100k.c
@@ -251,7 +251,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;