VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Dipankar Sarma <dipankar@in.ibm.com> 2005-09-15 00:48:42 +0530 committer: Linus Torvalds <torvalds@g5.osdl.org> 2005-09-14 12:38:26 -0700 commit: 0b175a7e68c2f51555820efb0a01681e3419c1bc parent: c7e43c78ae4d8630c418ce3495787b995e61a580
Commit Summary:
[PATCH] Fix the fdtable freeing in the case of vmalloced fdset/arrays
Diffstat:
1 file changed, 3 insertions, 6 deletions
diff --git a/fs/file.c b/fs/file.c
index 2127a7b9dc3a..fd066b261c75 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -69,13 +69,9 @@ void free_fd_array(struct file **array, int num)
 
 static void __free_fdtable(struct fdtable *fdt)
 {
-	int fdset_size, fdarray_size;
-
-	fdset_size = fdt->max_fdset / 8;
-	fdarray_size = fdt->max_fds * sizeof(struct file *);
-	free_fdset(fdt->open_fds, fdset_size);
-	free_fdset(fdt->close_on_exec, fdset_size);
-	free_fd_array(fdt->fd, fdarray_size);
+	free_fdset(fdt->open_fds, fdt->max_fdset);
+	free_fdset(fdt->close_on_exec, fdt->max_fdset);
+	free_fd_array(fdt->fd, fdt->max_fds);
 	kfree(fdt);
 }