All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
To: Mark Brown <broonie@kernel.org>
Cc: Robin Murphy <robin.murphy@arm.com>,
	Phil Elwell <phil@raspberrypi.com>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi: Skip zero-length transfers in spi_transfer_one_message()
Date: Fri, 12 Feb 2021 13:48:21 +0100	[thread overview]
Message-ID: <cd41a204107900c890b0234847fa0b62701f74cc.camel@suse.de> (raw)
In-Reply-To: <20210212123118.GB6057@sirena.org.uk>

[-- Attachment #1: Type: text/plain, Size: 645 bytes --]

On Fri, 2021-02-12 at 12:31 +0000, Mark Brown wrote:
> On Thu, Feb 11, 2021 at 07:08:20PM +0100, Nicolas Saenz Julienne wrote:
> 
> > -		if (xfer->tx_buf || xfer->rx_buf) {
> > +		if ((xfer->tx_buf || xfer->rx_buf) && xfer->len) {
> 
> I think the issue here is more that some users were passing in buffers
> with zero length transfers, the above check was already intended to
> catch this case but was working on the assumption that if there was
> nothing to transfer then no buffer would be provided.

Fair enough, maybe it makes sense to move the check into __spi_validate() and
propagate an error upwards?

Regads,
Nicolas


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-02-12 13:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-11 18:08 [PATCH] spi: Skip zero-length transfers in spi_transfer_one_message() Nicolas Saenz Julienne
2021-02-12 12:31 ` Mark Brown
2021-02-12 12:48   ` Nicolas Saenz Julienne [this message]
2021-02-12 12:52     ` Mark Brown
2021-02-12 12:57       ` Geert Uytterhoeven
2021-02-12 13:05         ` Mark Brown
2021-02-12 14:01 ` 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=cd41a204107900c890b0234847fa0b62701f74cc.camel@suse.de \
    --to=nsaenzjulienne@suse.de \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=phil@raspberrypi.com \
    --cc=robin.murphy@arm.com \
    /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.