From b901d40c970e6db319fe1f8d84db2b9684b6c9bf Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 28 Apr 2008 02:13:44 -0700 Subject: 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 --- arch/alpha/kernel/module.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/alpha') diff --git a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c index 026ba9af6d6a..ebc3c894b5a2 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; -- cgit v1.2.3-58-ga151