diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2012-06-05 13:10:28 (GMT) |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-14 12:33:20 (GMT) |
commit | aa4caadb70b782999ce5d150ac2f4b1d18e2fc75 (patch) | |
tree | 36b1b61f5badd818ff4322c13249ab68ad134379 /fs/namei.c | |
parent | 015c3bbcd88df2305aae5b017a9c91c08b380aa1 (diff) | |
download | linux-fsl-qoriq-aa4caadb70b782999ce5d150ac2f4b1d18e2fc75.tar.xz |
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.c | 23 |
1 files changed, 8 insertions, 15 deletions
@@ -2634,21 +2634,14 @@ common: if (error) goto exit_fput; opened: - if (!IS_ERR(filp)) { - error = ima_file_check(filp, op->acc_mode); - if (error) { - fput(filp); - filp = ERR_PTR(error); - } - } - if (!IS_ERR(filp)) { - if (will_truncate) { - error = handle_truncate(filp); - if (error) { - fput(filp); - filp = ERR_PTR(error); - } - } + error = ima_file_check(filp, op->acc_mode); + if (error) + goto exit_fput; + + if (will_truncate) { + error = handle_truncate(filp); + if (error) + goto exit_fput; } out: if (want_write) |