[<prev] [next>] [day] [month] [year] [list]
Message-Id: <200610011412.39072.vlobanov@speakeasy.net>
Date: Sun, 1 Oct 2006 14:12:38 -0700
From: Vadim Lobanov <vlobanov@...akeasy.net>
To: akpm@...l.org
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH 1/4] fdtable: Delete pointless code in dup_fd().
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@...akeasy.net>
diff -Npru old/kernel/fork.c new/kernel/fork.c
--- old/kernel/fork.c 2006-09-25 22:31:57.000000000 -0700
+++ new/kernel/fork.c 2006-09-25 22:35:01.000000000 -0700
@@ -727,14 +727,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;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists