pie/restorer: Fix fd leaking on error path

Nothing serious since OS will close it anyway but still to be precise.

Signed-off-by: Cyrill Gorcunov <gorcunov@virtuozzo.com>
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
This commit is contained in:
Cyrill Gorcunov 2019-07-15 17:34:13 +03:00 committed by Andrei Vagin
parent 1d4777e452
commit 2982867185

View file

@ -1960,6 +1960,7 @@ long __export_restore_task(struct task_restore_args *args)
}
if (ret != thread_args[i].pid) {
pr_err("Unable to create a thread: %ld\n", ret);
sys_close(fd);
mutex_unlock(&task_entries_local->last_pid_mutex);
goto core_restore_end;
}