Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2469 → Rev 2470

/trunk/kernel/generic/src/proc/thread.c
385,15 → 385,6
if (atomic_predec(&t->task->refcount) == 0)
task_destroy(t->task);
/*
* If the thread had a userspace context, free up its kernel_uarg
* structure.
*/
if (t->flags & THREAD_FLAG_USPACE) {
ASSERT(t->thread_arg);
free(t->thread_arg);
}
 
slab_free(thread_slab, t);
}
 
682,7 → 673,12
if (rc != 0)
return (unative_t) rc;
 
kernel_uarg = (uspace_arg_t *) malloc(sizeof(uspace_arg_t), 0);
/*
* In case of failure, kernel_uarg will be deallocated in this function.
* In case of success, kernel_uarg will be freed in uinit().
*/
kernel_uarg = (uspace_arg_t *) malloc(sizeof(uspace_arg_t), 0);
rc = copy_from_uspace(kernel_uarg, uspace_uarg, sizeof(uspace_arg_t));
if (rc != 0) {
free(kernel_uarg);
/trunk/uspace/libc/generic/thread.c
107,8 → 107,8
uarg->uspace_thread_function(uarg->uspace_thread_arg);
/* XXX: we cannot free the userspace stack while running on it */
free(uarg->uspace_stack);
free(uarg);
// free(uarg->uspace_stack);
// free(uarg);
 
/* If there is a manager, destroy it */
async_destroy_manager();