Clean up load_elf_binary unwind code (1) To prevent from reusing a deallocated files struct in load_elf_binary(), simplify the function's unwind code. Bailing out to the unwind code below the `point of no return' would be incorrect without this. Index: linux-2.4.22-rc2.orig/fs/binfmt_elf.c =================================================================== --- linux-2.4.22-rc2.orig.orig/fs/binfmt_elf.c 2003-08-09 01:52:16.000000000 +0200 +++ linux-2.4.22-rc2.orig/fs/binfmt_elf.c 2003-08-09 01:52:46.000000000 +0200 @@ -604,6 +604,7 @@ static int load_elf_binary(struct linux_ /* Discard our unneeded old files struct */ steal_locks(files); put_files_struct(files); + files = NULL; /* OK, This is the point of no return */ current->mm->start_data = 0; @@ -811,9 +812,11 @@ out_free_interp: out_free_file: sys_close(elf_exec_fileno); out_free_fh: - ftmp = current->files; - current->files = files; - put_files_struct(ftmp); + if (files) { + ftmp = current->files; + current->files = files; + put_files_struct(ftmp); + } out_free_ph: kfree(elf_phdata); goto out;