From: Miklos Szeredi Date: Tue, 5 Jun 2012 13:10:28 +0000 (+0200) Subject: vfs: do_last(): clean up error handling X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=aa4caadb70b782999ce5d150ac2f4b1d18e2fc75;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git vfs: do_last(): clean up error handling Signed-off-by: Miklos Szeredi Signed-off-by: Al Viro --- diff --git a/fs/namei.c b/fs/namei.c index 0ed876259f8b..044215a7bb0c 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -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)