The patch titled fdtable: Delete pointless code in dup_fd() has been removed from the -mm tree. Its filename was fdtable-delete-pointless-code-in-dup_fd.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ Subject: fdtable: Delete pointless code in dup_fd() From: Vadim Lobanov <vlobanov@xxxxxxxxxxxxx> The dup_fd() function creates a new files_struct and fdtable embedded inside that files_struct, and then possibly expands the fdtable using expand_files(). The out_release error path is invoked when expand_files() returns an error code. However, when this attempt to expand fails, the fdtable is left in its original embedded form, so it is pointless to try to free the associated fdarray and fdsets. Signed-off-by: Vadim Lobanov <vlobanov@xxxxxxxxxxxxx> Cc: Dipankar Sarma <dipankar@xxxxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxx> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- kernel/fork.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff -puN kernel/fork.c~fdtable-delete-pointless-code-in-dup_fd kernel/fork.c --- a/kernel/fork.c~fdtable-delete-pointless-code-in-dup_fd +++ a/kernel/fork.c @@ -711,8 +711,10 @@ static struct files_struct *dup_fd(struc old_fds = old_fdt->fd; new_fds = new_fdt->fd; - memcpy(new_fdt->open_fds->fds_bits, old_fdt->open_fds->fds_bits, open_files/8); - memcpy(new_fdt->close_on_exec->fds_bits, old_fdt->close_on_exec->fds_bits, open_files/8); + memcpy(new_fdt->open_fds->fds_bits, + old_fdt->open_fds->fds_bits, open_files/8); + memcpy(new_fdt->close_on_exec->fds_bits, + old_fdt->close_on_exec->fds_bits, open_files/8); for (i = open_files; i != 0; i--) { struct file *f = *old_fds++; @@ -745,14 +747,11 @@ static struct files_struct *dup_fd(struc memset(&new_fdt->close_on_exec->fds_bits[start], 0, left); } -out: return newf; out_release: - free_fdset (new_fdt->close_on_exec, new_fdt->max_fdset); - free_fdset (new_fdt->open_fds, new_fdt->max_fdset); - free_fd_array(new_fdt->fd, new_fdt->max_fds); kmem_cache_free(files_cachep, newf); +out: return NULL; } _ Patches currently in -mm which might be from vlobanov@xxxxxxxxxxxxx are origin.patch fdtable-make-fdarray-and-fdsets-equal-in-size-slim.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html