Commit c155a47d authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

modpost: do not write out any file when error occurred



If an error occurs, modpost will fail anyway. Do not write out
any content (, which might be invalid).

Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
parent 15a28c7c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2333,6 +2333,9 @@ static void write_buf(struct buffer *b, const char *fname)
{
	FILE *file;

	if (error_occurred)
		return;

	file = fopen(fname, "w");
	if (!file) {
		perror(fname);