Messages in this thread | | | Date | Thu, 17 Apr 2008 15:02:53 +0200 | From | Ingo Molnar <> | Subject | Re: Possible mem leak in copy_process() |
| |
* Oleg Nesterov <oleg@tv-sign.ru> wrote:
> > 1331 if (likely(p->pid)) {
> > 1351 }
> > Event leaked_storage: Returned without freeing storage "pid" Also > > see events: [alloc_fn][var_assign][pass_arg] > > this looks like a false alarm. > > p->pid == pid->numbers[0].nr. If "struct pid *pid" was allocated, its > .nr can't be 0. > > IOW, !p->pid means that pid == init_struct_pid, it wasn't allocated > but was passed from the caller.
should we perhaps codify this rule via adding something like this to the else branch:
WARN_ON_ONCE(task_pid(p) != &init_struct_pid);
?
Ingo
| |