Re: [PATCH] tracing/filters: Defer pred allocation

Li Zefan
2009-09-01T00:52:12Z

>> @@ -1094,6 +1118,10 @@ int apply_event_filter(struct ftrace_event_call *call, char *filter_string)
>>
>> mutex_lock(&event_mutex);
>>
>> + err = init_preds(call);
>> + if (err)
>> + goto out_unlock;
>
>
>
> Hmm, but what happens if the filter already has its preds initialized
> by a previous filter?
>
> The first thing that init_preds() does is:
>
> filter = call->filter = kzalloc(sizeof(*filter), GFP_KERNEL);
>
> That looks like a memory leak.
>

Oops! I thought I had added a check in it.

Thanks.