Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

alpha: handle kcalloc failure

arch/alpha/kernel/module.c (module_frob_arch_sections): Handle kcalloc failure.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jim Meyering and committed by
Linus Torvalds
b901d40c 1236cc3c

+6
+6
arch/alpha/kernel/module.c
··· 120 120 121 121 nsyms = symtab->sh_size / sizeof(Elf64_Sym); 122 122 chains = kcalloc(nsyms, sizeof(struct got_entry), GFP_KERNEL); 123 + if (!chains) { 124 + printk(KERN_ERR 125 + "module %s: no memory for symbol chain buffer\n", 126 + me->name); 127 + return -ENOMEM; 128 + } 123 129 124 130 got->sh_size = 0; 125 131 got->sh_addralign = 8;