From: Jim Meyering Date: Mon, 28 Apr 2008 09:13:44 +0000 (-0700) Subject: alpha: handle kcalloc failure X-Git-Tag: v2.6.26-rc1~918 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=b901d40c970e6db319fe1f8d84db2b9684b6c9bf;p=linux-2.6-omap-h63xx.git alpha: handle kcalloc failure arch/alpha/kernel/module.c (module_frob_arch_sections): Handle kcalloc failure. Signed-off-by: Jim Meyering Cc: Richard Henderson Cc: Ivan Kokshaysky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c index 026ba9af6d6..ebc3c894b5a 100644 --- a/arch/alpha/kernel/module.c +++ b/arch/alpha/kernel/module.c @@ -120,6 +120,12 @@ module_frob_arch_sections(Elf64_Ehdr *hdr, Elf64_Shdr *sechdrs, nsyms = symtab->sh_size / sizeof(Elf64_Sym); chains = kcalloc(nsyms, sizeof(struct got_entry), GFP_KERNEL); + if (!chains) { + printk(KERN_ERR + "module %s: no memory for symbol chain buffer\n", + me->name); + return -ENOMEM; + } got->sh_size = 0; got->sh_addralign = 8;