Commit aa4caadb authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Al Viro

vfs: do_last(): clean up error handling

Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 015c3bbc
......@@ -2634,21 +2634,14 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
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 (error)
goto exit_fput;
if (will_truncate) {
error = handle_truncate(filp);
if (error) {
fput(filp);
filp = ERR_PTR(error);
}
}
if (error)
goto exit_fput;
}
out:
if (want_write)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment