summaryrefslogtreecommitdiff
path: root/scripts/mod/modpost.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-27 09:17:14 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-27 09:17:14 +0300
commitc97793089b11f736287b65abe3d530d5ffd3857b (patch)
tree6944831ba049777b40aed51c75bf6dc637cc98e4 /scripts/mod/modpost.c
parent9a360a7cae11461ccd933a9ea366b0dcb3afadb0 (diff)
parent92ed301919932f777713b9172e525674157e983d (diff)
downloadlinux-c97793089b11f736287b65abe3d530d5ffd3857b.tar.xz
Merge 5.8-rc7 into usb-next
We want the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.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 */