dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
Miklos Szeredi 2012-06-05 15:10:28 +02:00 committed by Al Viro
parent 015c3bbcd8
commit aa4caadb70
1 changed files with 8 additions and 15 deletions

View File

@ -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)