Skip to content

Commit

Permalink
spi: omap-100k: Fix the length judgment problem
Browse files Browse the repository at this point in the history
[ Upstream commit e7a1a3a ]

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>
  • Loading branch information
Tian Tao authored and gregkh committed Jul 14, 2021
1 parent 257c2df commit 1261a8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi-omap-100k.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 1261a8f

Please sign in to comment.