Messages in this thread | | | Date | Thu, 13 Mar 2014 19:24:17 +0000 | From | Mark Brown <> | Subject | Re: [PATCH] regmap: irq: Set data pointer only on regmap_add_irq_chip success |
| |
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. [unhandled content-type:application/pgp-signature] | |