Re: [PATCH] regmap: irq: Set data pointer only on regmap_add_irq_chip success

From: Mark Brown
Date: Thu Mar 13 2014 - 15:24:34 EST


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: signature.asc
Description: Digital signature