提交 c155a47d 编写于 作者: M Masahiro Yamada

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: NMasahiro Yamada <masahiroy@kernel.org>
Reviewed-by: NNick Desaulniers <ndesaulniers@google.com>
上级 15a28c7c
...@@ -2333,6 +2333,9 @@ static void write_buf(struct buffer *b, const char *fname) ...@@ -2333,6 +2333,9 @@ static void write_buf(struct buffer *b, const char *fname)
{ {
FILE *file; FILE *file;
if (error_occurred)
return;
file = fopen(fname, "w"); file = fopen(fname, "w");
if (!file) { if (!file) {
perror(fname); perror(fname);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册