kernel: handle: init handle table duplication
This commit is contained in:
@@ -468,6 +468,14 @@ kern_status_t sys_task_duplicate(
|
||||
unsigned long flags;
|
||||
task_lock_irqsave(self, &flags);
|
||||
|
||||
struct handle_table *child_handle_table = NULL;
|
||||
status = handle_table_duplicate(self->t_handles, &child_handle_table);
|
||||
if (status != KERN_OK) {
|
||||
task_unlock_irqrestore(self, flags);
|
||||
put_current_task(self);
|
||||
return status;
|
||||
}
|
||||
|
||||
struct handle *child_handle_slot = NULL, *space_handle_slot = NULL;
|
||||
kern_handle_t child_handle, space_handle;
|
||||
status = handle_table_alloc_handle(
|
||||
@@ -476,6 +484,7 @@ kern_status_t sys_task_duplicate(
|
||||
&child_handle_slot,
|
||||
&child_handle);
|
||||
if (status != KERN_OK) {
|
||||
handle_table_destroy(child_handle_table);
|
||||
task_unlock_irqrestore(self, flags);
|
||||
put_current_task(self);
|
||||
return status;
|
||||
@@ -487,6 +496,7 @@ kern_status_t sys_task_duplicate(
|
||||
&space_handle_slot,
|
||||
&space_handle);
|
||||
if (status != KERN_OK) {
|
||||
handle_table_destroy(child_handle_table);
|
||||
handle_table_free_handle(self->t_handles, child_handle);
|
||||
task_unlock_irqrestore(self, flags);
|
||||
put_current_task(self);
|
||||
|
||||
Reference in New Issue
Block a user