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

vfs: do_last(): clean up error handling

parent 015c3bbc
Loading
Loading
Loading
Loading
+8 −15
Original line number Original line Diff line number Diff line
@@ -2634,21 +2634,14 @@ common:
	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)
			fput(filp);
		goto exit_fput;
			filp = ERR_PTR(error);

		}
	}
	if (!IS_ERR(filp)) {
	if (will_truncate) {
	if (will_truncate) {
		error = handle_truncate(filp);
		error = handle_truncate(filp);
			if (error) {
		if (error)
				fput(filp);
			goto exit_fput;
				filp = ERR_PTR(error);
			}
		}
	}
	}
out:
out:
	if (want_write)
	if (want_write)