Re: [PATCH 3/6] taskstats_tgid_free: fix usage

From: Balbir Singh
Date: Mon Oct 30 2006 - 21:50:50 EST


Oleg Nesterov wrote:
> taskstats_tgid_free() is called on copy_process's error path. This is wrong.
>
> IF (clone_flags & CLONE_THREAD)
> We should not clear ->signal->taskstats, current uses it,
> it probably has a valid accumulated info.
> ELSE
> taskstats_tgid_init() set ->signal->taskstats = NULL,
> there is nothing to free.
>
> Move the callsite to __exit_signal(). We don't need any locking, entire
> thread group is exiting, nobody should have a reference to soon to be
> released ->signal.
>
> Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>

Looks good!
Acked-by: Balbir Singh <balbir@xxxxxxxxxx>

---

Balbir Singh,
Linux Technology Center,
IBM Software Labs
-
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/