All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Lukas Wunner <lukas@wunner.de>
Cc: Jay Fang <f.fangjian@huawei.com>,
	linux-spi@vger.kernel.org, huangdaode@huawei.com
Subject: Re: [PATCH] spi: Add HiSilicon SPI controller driver support
Date: Mon, 8 Mar 2021 18:28:09 +0000	[thread overview]
Message-ID: <20210308182809.GG4656@sirena.org.uk> (raw)
In-Reply-To: <20210308181839.GA6444@wunner.de>

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

On Mon, Mar 08, 2021 at 07:18:39PM +0100, Lukas Wunner wrote:
> On Mon, Mar 08, 2021 at 02:11:01PM +0000, Mark Brown wrote:

> > It's also important and even more of a concern that even if there is a
> > valid interrupt the handler doesn't try to use structures that might
> > have been deallocated before the handler uses it as this controller
> > does, that will segfault which is more serious.

> At least struct spi_controller and struct hisi_spi are allocated with
> devm_*() before the call to devm_request_irq(), hence those two
> are always accessible from the IRQ handler AFAICS.

For stuff like this I'd rather the code were obviously correct rather
than having to think about it, dereferencing the struct is the most
obvious thing but there's also the possibility that we cause something
else to happen which explodes on us, or that someone later modifies the
code in a way that introduces an issue.  It does look safe right now but
the whole implicitly managed asynchronous code thing always makes me
nervous.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-03-08 18:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01 11:56 [PATCH] spi: Add HiSilicon SPI controller driver support Jay Fang
2021-03-01 13:54 ` Mark Brown
2021-03-04  6:54   ` Fangjian (Jay)
     [not found]   ` <79a0bb79-654b-8afc-f34a-c3a08bae275c@huawei.com>
2021-03-04 12:34     ` Mark Brown
2021-03-08 11:24       ` Jay Fang
2021-03-07 14:43   ` Lukas Wunner
2021-03-08 14:11     ` Mark Brown
2021-03-08 18:18       ` Lukas Wunner
2021-03-08 18:28         ` Mark Brown [this message]
2021-03-09  9:13     ` Jay Fang
2021-03-07 14:36 ` Lukas Wunner
2021-03-08  3:57   ` Jay Fang
2021-03-08  8:06     ` Lukas Wunner

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=20210308182809.GG4656@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=f.fangjian@huawei.com \
    --cc=huangdaode@huawei.com \
    --cc=linux-spi@vger.kernel.org \
    --cc=lukas@wunner.de \
    /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.