summaryrefslogtreecommitdiffstats
path: root/common/elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/elf.c')
-rw-r--r--common/elf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/elf.c b/common/elf.c
index 55f5bc6455..0e92661e1a 100644
--- a/common/elf.c
+++ b/common/elf.c
@@ -19,7 +19,10 @@ static int elf_request_region(struct elf_image *elf, resource_size_t start,
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);