From: Wang Wensheng wangwensheng4@huawei.com
hulk inclusion category: bugfix bugzilla: 46847 CVE: NA
-----------------------------------------------
This reverts commit adcfc4574d9860c4a5d3f855438f0767bfaee7f7.
This series of patches could raise an issue on module built.
Signed-off-by: Wang Wensheng wangwensheng4@huawei.com Reviewed-by: Jian Cheng cj.chengjian@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- scripts/mod/modpost.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index ed5e38df9a7dc..97d81f6396219 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -160,19 +160,11 @@ char *read_text_file(const char *filename)
char *get_line(char **stringp) { - char *orig = *stringp, *next; - /* do not return the unwanted extra line at EOF */ - if (!orig || *orig == '\0') + if (*stringp && **stringp == '\0') return NULL;
- next = strchr(orig, '\n'); - if (next) - *next++ = '\0'; - - *stringp = next; - - return orig; + return strsep(stringp, "\n"); }
/* A list of all modules we processed */