X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=kernel%2Fkexec_file.c;h=c6a3b6851372c480005d4f053757ba02ad101d8f;hb=7a3369e8a78538e813e96294b8c7fce9feb76e0f;hp=75d8e7cf040e69bfcde16fb555c09054cfe9ebad;hpb=d792b32688c65841aef256e5870f0e25ed69ed9c;p=mirror_ubuntu-focal-kernel.git diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index 75d8e7cf040e..c6a3b6851372 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -793,7 +793,7 @@ static int kexec_purgatory_setup_sechdrs(struct purgatory_info *pi, * The section headers in kexec_purgatory are read-only. In order to * have them modifiable make a temporary copy. */ - sechdrs = vzalloc(pi->ehdr->e_shnum * sizeof(Elf_Shdr)); + sechdrs = vzalloc(array_size(sizeof(Elf_Shdr), pi->ehdr->e_shnum)); if (!sechdrs) return -ENOMEM; memcpy(sechdrs, (void *)pi->ehdr + pi->ehdr->e_shoff,