mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
This commit is contained in:
parent
15a28c7c72
commit
c155a47d83
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue