From: Wang Wensheng wangwensheng4@huawei.com
hulk inclusion category: bugfix bugzilla: 46847 CVE: NA
-----------------------------------------------
This reverts commit 18aa51a2f1e0a47bd959af44140bd6a6c06c90d8.
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 | 49 ------------------------------------------- scripts/mod/modpost.h | 2 -- 2 files changed, 51 deletions(-)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 97d81f6396219..7c693bd775c1b 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -118,55 +118,6 @@ void *do_nofail(void *ptr, const char *expr) return ptr; }
-char *read_text_file(const char *filename) -{ - struct stat st; - size_t nbytes; - int fd; - char *buf; - - fd = open(filename, O_RDONLY); - if (fd < 0) { - perror(filename); - exit(1); - } - - if (fstat(fd, &st) < 0) { - perror(filename); - exit(1); - } - - buf = NOFAIL(malloc(st.st_size + 1)); - - nbytes = st.st_size; - - while (nbytes) { - ssize_t bytes_read; - - bytes_read = read(fd, buf, nbytes); - if (bytes_read < 0) { - perror(filename); - exit(1); - } - - nbytes -= bytes_read; - } - buf[st.st_size] = '\0'; - - close(fd); - - return buf; -} - -char *get_line(char **stringp) -{ - /* do not return the unwanted extra line at EOF */ - if (*stringp && **stringp == '\0') - return NULL; - - return strsep(stringp, "\n"); -} - /* A list of all modules we processed */ static struct module *modules;
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h index ff809119f82bb..8453d6ac2f77e 100644 --- a/scripts/mod/modpost.h +++ b/scripts/mod/modpost.h @@ -185,8 +185,6 @@ void maybe_frob_rcs_version(const char *modfilename, void get_src_version(const char *modname, char sum[], unsigned sumlen);
/* from modpost.c */ -char *read_text_file(const char *filename); -char *get_line(char **stringp); void *grab_file(const char *filename, unsigned long *size); char* get_next_line(unsigned long *pos, void *file, unsigned long size); void release_file(void *file, unsigned long size);