struct elf32_phdr *phdr;
unsigned long load_addr, stop;
unsigned nloads, tmp;
struct elf32_phdr *phdr;
unsigned long load_addr, stop;
unsigned nloads, tmp;
int loop, ret;
/* allocate a load map table */
int loop, ret;
/* allocate a load map table */
if (nloads == 0)
return -ELIBBAD;
if (nloads == 0)
return -ELIBBAD;
- size = sizeof(*loadmap) + nloads * sizeof(*seg);
- loadmap = kzalloc(size, GFP_KERNEL);
+ loadmap = kzalloc(struct_size(loadmap, segs, nloads), GFP_KERNEL);
if (!loadmap)
return -ENOMEM;
if (!loadmap)
return -ENOMEM;