Messages in this thread Patch in this message | | | From | Miklos Szeredi <> | Subject | [PATCH 17/21] vfs: do_last(): clean up error handling | Date | Tue, 5 Jun 2012 15:10:28 +0200 |
| |
From: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> --- fs/namei.c | 23 ++++++++--------------- 1 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/fs/namei.c b/fs/namei.c index 47d81f4..55f5f27 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2625,21 +2625,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) -- 1.7.7
| |