diff --git a/common/elf.c b/common/elf.c index 55f5bc6..0e92661 100644 --- a/common/elf.c +++ b/common/elf.c @@ -19,7 +19,10 @@ struct resource *r_new; struct elf_section *r; - r = xzalloc(sizeof(*r)); + r = calloc(1, sizeof(*r)); + if (!r) + return -ENOMEM; + r_new = request_sdram_region("elf_section", start, size); if (!r_new) { pr_err("Failed to request region: %pa %pa\n", &start, &size);