提交 aa4caadb 编写于 作者: M Miklos Szeredi 提交者: Al Viro

vfs: do_last(): clean up error handling

Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 015c3bbc
...@@ -2634,21 +2634,14 @@ static struct file *do_last(struct nameidata *nd, struct path *path, ...@@ -2634,21 +2634,14 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
if (error) if (error)
goto exit_fput; goto exit_fput;
opened: opened:
if (!IS_ERR(filp)) { error = ima_file_check(filp, op->acc_mode);
error = ima_file_check(filp, op->acc_mode); if (error)
if (error) { goto exit_fput;
fput(filp);
filp = ERR_PTR(error); if (will_truncate) {
} error = handle_truncate(filp);
} if (error)
if (!IS_ERR(filp)) { goto exit_fput;
if (will_truncate) {
error = handle_truncate(filp);
if (error) {
fput(filp);
filp = ERR_PTR(error);
}
}
} }
out: out:
if (want_write) if (want_write)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册