Fix missing error check for memory allocation functions in
scripts/mod/modpost.c.
Fixes kernel bugzilla #200319:
https://bugzilla.kernel.org/show_bug.cgi?id=200319
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Yuexing Wang <wangyxlandq@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
if (ELF_ST_TYPE(sym->st_info) == STT_SPARC_REGISTER)
break;
if (symname[0] == '.') {
if (ELF_ST_TYPE(sym->st_info) == STT_SPARC_REGISTER)
break;
if (symname[0] == '.') {
- char *munged = strdup(symname);
+ char *munged = NOFAIL(strdup(symname));
munged[0] = '_';
munged[1] = toupper(munged[1]);
symname = munged;
munged[0] = '_';
munged[1] = toupper(munged[1]);
symname = munged;
static char *sec2annotation(const char *s)
{
if (match(s, init_exit_sections)) {
static char *sec2annotation(const char *s)
{
if (match(s, init_exit_sections)) {
+ char *p = NOFAIL(malloc(20));
strcat(p, " ");
return r;
} else {
strcat(p, " ");
return r;
} else {
+ return NOFAIL(strdup(""));
{
if (buf->size - buf->pos < len) {
buf->size += len + SZ;
{
if (buf->size - buf->pos < len) {
buf->size += len + SZ;
- buf->p = realloc(buf->p, buf->size);
+ buf->p = NOFAIL(realloc(buf->p, buf->size));
}
strncpy(buf->p + buf->pos, s, len);
buf->pos += len;
}
strncpy(buf->p + buf->pos, s, len);
buf->pos += len;