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

From: Li Zefan
Date: Mon Aug 31 2009 - 20:52:19 EST


>> @@ -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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/