lkml.org 
[lkml]   [2010]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -tip 5/5] tracing: simplify memory recycle of trace_define_field
Wenji Huang wrote:
> On 02/24/2010 04:04 PM, Li Zefan wrote:
>> Wenji Huang wrote:
>>> Discard freeing field->type since it's not necessary and may be hazard.
>>>
>>
>> It's redundant, but it's safe, because if we run into this failure path,
>> field->type is always NULL.
>
> There are two entries to failure path, field->name == NULL or
> field->type == NULL. And allocating for field->name is before field->type.
>
> IMHO, field->type is not fixed after initialization, it's
> not safe if field->name==NULL goes to failure path.
>

It's still safe, because field is allocated using kzalloc(). ;)



\
 
 \ /
  Last update: 2010-02-24 09:29    [W:0.449 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site