All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tian Tao <tiantao6@hisilicon.com>
To: <broonie@kernel.org>
Cc: <linux-spi@vger.kernel.org>, Tian Tao <tiantao6@hisilicon.com>
Subject: [PATCH] spi: omap-100k: Fix the length judgment problem
Date: Thu, 29 Apr 2021 19:20:48 +0800	[thread overview]
Message-ID: <1619695248-39045-1-git-send-email-tiantao6@hisilicon.com> (raw)

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>
---
 drivers/spi/spi-omap-100k.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c
index 7062f29..f104470 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;
 
-- 
2.7.4


             reply	other threads:[~2021-04-29 11:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29 11:20 Tian Tao [this message]
2021-05-11  8:25 ` [PATCH] spi: omap-100k: Fix the length judgment problem Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1619695248-39045-1-git-send-email-tiantao6@hisilicon.com \
    --to=tiantao6@hisilicon.com \
    --cc=broonie@kernel.org \
    --cc=linux-spi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.