aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 83beb1e93b18..6d2089a1bce7 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -411,15 +411,16 @@ void fastcall put_files_struct(struct files_struct *files)
411 close_files(files); 411 close_files(files);
412 /* 412 /*
413 * Free the fd and fdset arrays if we expanded them. 413 * Free the fd and fdset arrays if we expanded them.
414 * If the fdtable was embedded, pass files for freeing
415 * at the end of the RCU grace period. Otherwise,
416 * you can free files immediately.
414 */ 417 */
415 fdt = files_fdtable(files); 418 fdt = files_fdtable(files);
416 if (fdt->fd != &files->fd_array[0]) 419 if (fdt == &files->fdtab)
417 free_fd_array(fdt->fd, fdt->max_fds); 420 fdt->free_files = files;
418 if (fdt->max_fdset > __FD_SETSIZE) { 421 else
419 free_fdset(fdt->open_fds, fdt->max_fdset); 422 kmem_cache_free(files_cachep, files);
420 free_fdset(fdt->close_on_exec, fdt->max_fdset); 423 free_fdtable(fdt);
421 }
422 kmem_cache_free(files_cachep, files);
423 } 424 }
424} 425}
425 426