Skip to content
Snippets Groups Projects
Commit eba07d7d authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Yang Yingliang
Browse files

modpost: use read_text_file() and get_line() for reading text files


mainline inclusion
from mainline-5.8
commit 70f30cfe
category: bugfix
bugzilla: 46847
CVE: NA

------------------------------------------------

grab_file() mmaps a file, but it is not so efficient here because
get_next_line() copies every line to the temporary buffer anyway.

read_text_file() and get_line() are simpler. get_line() exploits the
library function strchr().

Going forward, the missing *.symvers or *.cmd is a fatal error.
This should not happen because scripts/Makefile.modpost guards the
-i option files with $(wildcard $(input-symdump)).

Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>

Drop the changes in modpost.c since the missing *.symvers or *.cmd is
a fatal error and we don't check it in scripts/Makefile.modpost
currently, on which curimistance the building process for modules would
be interrupted with an error. This isn't what we expect.

Signed-off-by: default avatarWang Wensheng <wangwensheng4@huawei.com>
Reviewed-by: default avatarJian Cheng <cj.chengjian@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 2c3c5b69
No related branches found
No related tags found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment