summaryrefslogtreecommitdiffstats
path: root/buildtools
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2017-11-08 14:15:11 +0000
committerLuca Boccassi <luca.boccassi@gmail.com>2017-11-08 14:45:54 +0000
commit055c52583a2794da8ba1e85a48cce3832372b12f (patch)
tree8ceb1cb78fbb46a0f341f8ee24feb3c6b5540013 /buildtools
parentf239aed5e674965691846e8ce3f187dd47523689 (diff)
New upstream version 17.11-rc3
Change-Id: I6a5baa40612fe0c20f30b5fa773a6cbbac63a685 Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'buildtools')
-rwxr-xr-xbuildtools/auto-config-h.sh6
-rw-r--r--buildtools/pmdinfogen/pmdinfogen.c9
2 files changed, 10 insertions, 5 deletions
diff --git a/buildtools/auto-config-h.sh b/buildtools/auto-config-h.sh
index 4356d7e3..cb8bce9b 100755
--- a/buildtools/auto-config-h.sh
+++ b/buildtools/auto-config-h.sh
@@ -114,9 +114,9 @@ printf "\
" "$include" "$code" > "${temp}" &&
if ${CC} ${CPPFLAGS} ${EXTRA_CPPFLAGS} ${CFLAGS} ${EXTRA_CFLAGS} \
${AUTO_CONFIG_CFLAGS} \
- -c -o /dev/null "${temp}" 1>&${out} 2>&${err}
+ -c -o ${temp}.o "${temp}" 1>&${out} 2>&${err}
then
- rm -f "${temp}"
+ rm -f "${temp}" "${temp}.o"
printf "\
#ifndef %s
#define %s 1
@@ -125,7 +125,7 @@ then
" "${macro}" "${macro}" "${macro}" >> "${file}" &&
printf 'Defining %s.\n' "${macro}"
else
- rm -f "${temp}"
+ rm -f "${temp}" "${temp}.o"
printf "\
/* %s is not defined. */
diff --git a/buildtools/pmdinfogen/pmdinfogen.c b/buildtools/pmdinfogen/pmdinfogen.c
index ba1a12e2..96ccbf33 100644
--- a/buildtools/pmdinfogen/pmdinfogen.c
+++ b/buildtools/pmdinfogen/pmdinfogen.c
@@ -327,6 +327,10 @@ static int locate_pmd_entries(struct elf_info *info)
do {
new = calloc(sizeof(struct pmd_driver), 1);
+ if (new == NULL) {
+ fprintf(stderr, "Failed to calloc memory\n");
+ return -1;
+ }
new->name_sym = find_sym_in_symtab(info, "this_pmd_name", last);
last = new->name_sym;
if (!new->name_sym)
@@ -397,7 +401,7 @@ static void output_pmd_info_string(struct elf_info *info, char *outfile)
int main(int argc, char **argv)
{
- struct elf_info info;
+ struct elf_info info = {0};
int rc = 1;
if (argc < 3) {
@@ -408,7 +412,8 @@ int main(int argc, char **argv)
}
parse_elf(&info, argv[1]);
- locate_pmd_entries(&info);
+ if (locate_pmd_entries(&info) < 0)
+ exit(1);
if (info.drivers) {
output_pmd_info_string(&info, argv[2]);