lkml.org 
[lkml]   [2014]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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]
\
 
 \ /
  Last update: 2014-03-13 21:01    [W:0.185 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site