X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=scripts%2Fkallsyms.c;h=22d281c6ec244c16bb0dc1c870e7f5c5ce913fb5;hb=47dcf0cb1005e86d0eea780f2984b2e7490f63cd;hp=d591578bd3b209ab8258a814b30727366e8909d8;hpb=64e47488c913ac704d465a6af86a26786d1412a5;p=powerpc.git diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index d591578bd3..22d281c6ec 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -124,6 +124,11 @@ static int read_symbol(FILE *in, struct sym_entry *s) * compressed together */ s->len = strlen(str) + 1; s->sym = malloc(s->len + 1); + if (!s->sym) { + fprintf(stderr, "kallsyms failure: " + "unable to allocate required amount of memory\n"); + exit(EXIT_FAILURE); + } strcpy((char *)s->sym + 1, str); s->sym[0] = stype; @@ -272,7 +277,12 @@ static void write_src(void) /* table of offset markers, that give the offset in the compressed stream * every 256 symbols */ - markers = (unsigned int *) malloc(sizeof(unsigned int) * ((table_cnt + 255) / 256)); + markers = malloc(sizeof(unsigned int) * ((table_cnt + 255) / 256)); + if (!markers) { + fprintf(stderr, "kallsyms failure: " + "unable to allocate required memory\n"); + exit(EXIT_FAILURE); + } output_label("kallsyms_names"); off = 0;