summaryrefslogtreecommitdiff
path: root/fs/binfmt_elf_fdpic.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/binfmt_elf_fdpic.c')
-rw-r--r--fs/binfmt_elf_fdpic.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index 48fd2de3bca0..cee0871b0164 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -761,7 +761,7 @@ static int elf_fdpic_map_file(struct elf_fdpic_params *params,
if (nloads == 0)
return -ELIBBAD;
- loadmap = kzalloc(struct_size(loadmap, segs, nloads), GFP_KERNEL);
+ loadmap = kzalloc_flex(*loadmap, segs, nloads, GFP_KERNEL);
if (!loadmap)
return -ENOMEM;
@@ -1391,7 +1391,7 @@ static struct elf_thread_status *elf_dump_thread_status(long signr, struct task_
struct elf_thread_status *t;
int i, ret;
- t = kzalloc(sizeof(struct elf_thread_status), GFP_KERNEL);
+ t = kzalloc_obj(struct elf_thread_status, GFP_KERNEL);
if (!t)
return t;
@@ -1486,10 +1486,10 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
struct elf_thread_status *tmp;
/* alloc memory for large data structures: too large to be on stack */
- elf = kmalloc(sizeof(*elf), GFP_KERNEL);
+ elf = kmalloc_obj(*elf, GFP_KERNEL);
if (!elf)
goto end_coredump;
- psinfo = kmalloc(sizeof(*psinfo), GFP_KERNEL);
+ psinfo = kmalloc_obj(*psinfo, GFP_KERNEL);
if (!psinfo)
goto end_coredump;
@@ -1547,7 +1547,7 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
offset += segs * sizeof(struct elf_phdr); /* Program headers */
/* Write notes phdr entry */
- phdr4note = kmalloc(sizeof(*phdr4note), GFP_KERNEL);
+ phdr4note = kmalloc_obj(*phdr4note, GFP_KERNEL);
if (!phdr4note)
goto end_coredump;
@@ -1562,7 +1562,7 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
e_shoff = offset;
if (e_phnum == PN_XNUM) {
- shdr4extnum = kmalloc(sizeof(*shdr4extnum), GFP_KERNEL);
+ shdr4extnum = kmalloc_obj(*shdr4extnum, GFP_KERNEL);
if (!shdr4extnum)
goto end_coredump;
fill_extnum_info(elf, shdr4extnum, e_shoff, segs);