aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2012-06-05 09:10:28 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 08:33:20 -0400
commitaa4caadb70b782999ce5d150ac2f4b1d18e2fc75 (patch)
tree36b1b61f5badd818ff4322c13249ab68ad134379 /fs/namei.c
parent015c3bbcd88df2305aae5b017a9c91c08b380aa1 (diff)
vfs: do_last(): clean up error handling
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 0ed876259f8b..044215a7bb0c 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2634,21 +2634,14 @@ common:
2634 if (error) 2634 if (error)
2635 goto exit_fput; 2635 goto exit_fput;
2636opened: 2636opened:
2637 if (!IS_ERR(filp)) { 2637 error = ima_file_check(filp, op->acc_mode);
2638 error = ima_file_check(filp, op->acc_mode); 2638 if (error)
2639 if (error) { 2639 goto exit_fput;
2640 fput(filp); 2640
2641 filp = ERR_PTR(error); 2641 if (will_truncate) {
2642 } 2642 error = handle_truncate(filp);
2643 } 2643 if (error)
2644 if (!IS_ERR(filp)) { 2644 goto exit_fput;
2645 if (will_truncate) {
2646 error = handle_truncate(filp);
2647 if (error) {
2648 fput(filp);
2649 filp = ERR_PTR(error);
2650 }
2651 }
2652 } 2645 }
2653out: 2646out:
2654 if (want_write) 2647 if (want_write)