From: Mark Brown <broonie@kernel.org>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regmap: irq: Set data pointer only on regmap_add_irq_chip success
Date: Thu, 13 Mar 2014 19:24:17 +0000 [thread overview]
Message-ID: <20140313192417.GK366@sirena.org.uk> (raw)
In-Reply-To: <1394721184.20773.15.camel@AMDC1943>
[-- Attachment #1: Type: text/plain, Size: 635 bytes --]
On Thu, Mar 13, 2014 at 03:33:04PM +0100, Krzysztof Kozlowski wrote:
> Yes, you're right but still I think that 'data' should be set in a
> atomic way - only if regmap_add_irq_chip() succeeds. Usually a caller
> passing a pointer for allocation expects that one of:
> 1. Allocation succeeds and it is put under passed pointer;
> 2. Allocation fails and no one touches my pointer.
Yeah, I probably will apply it but on the other hand nothing should be
relying on this - the caller is just plain buggy, it's not really even
supposed to be aware of the existence of data in the first place and is
doing the equivalent of a double free.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-03-13 19:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-13 8:06 [PATCH] regmap: irq: Set data pointer only on regmap_add_irq_chip success Krzysztof Kozlowski
2014-03-13 14:13 ` Mark Brown
2014-03-13 14:33 ` Krzysztof Kozlowski
2014-03-13 19:24 ` Mark Brown [this message]
2014-03-13 21:47 ` 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=20140313192417.GK366@sirena.org.uk \
--to=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=k.kozlowski@samsung.com \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox