summaryrefslogtreecommitdiff
path: root/scripts/mod/modpost.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2020-07-27 12:41:13 +0200
committerIngo Molnar <mingo@kernel.org>2020-07-27 12:41:13 +0200
commit538b10856b1eb60bd6305fa2f20191b12d997ba1 (patch)
tree90574cc0c49f9c9084661c9c80c3730feb249984 /scripts/mod/modpost.c
parent3aae57f0c3ba57715cf89201b5a5f290684078a5 (diff)
parent92ed301919932f777713b9172e525674157e983d (diff)
downloadlinux-538b10856b1eb60bd6305fa2f20191b12d997ba1.tar.gz
linux-538b10856b1eb60bd6305fa2f20191b12d997ba1.zip
Merge tag 'v5.8-rc7' into x86/cpu, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'scripts/mod/modpost.c')
-rw-r--r--scripts/mod/modpost.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 6aea65c65745..45f2ab2ec2d4 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -138,11 +138,19 @@ 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 (*stringp && **stringp == '\0')
+ if (!orig || *orig == '\0')
return NULL;
- return strsep(stringp, "\n");
+ next = strchr(orig, '\n');
+ if (next)
+ *next++ = '\0';
+
+ *stringp = next;
+
+ return orig;
}
/* A list of all modules we processed */