summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/module_64.c
diff options
context:
space:
mode:
authorKamalesh Babulal <kamalesh@linux.vnet.ibm.com>2017-10-10 16:47:32 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2017-10-13 10:41:57 +0200
commit1c0437af9fca8de6e4ba179d18cf13154da25695 (patch)
tree3812b396b65a7668faa78dcf7c03cc64c8f5d2ab /arch/powerpc/kernel/module_64.c
parentcxl: Dump PSL_FIR register on PSL9 error irq (diff)
downloadlinux-1c0437af9fca8de6e4ba179d18cf13154da25695.tar.xz
linux-1c0437af9fca8de6e4ba179d18cf13154da25695.zip
powerpc/modules: Use WARN_ON() in stub_for_addr()
Use WARN_ON(), while running out of stubs in stub_for_addr() and abort loading of the module instead of BUG_ON(). Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/module_64.c')
-rw-r--r--arch/powerpc/kernel/module_64.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c
index 0b0f89685b67..759104b99f9f 100644
--- a/arch/powerpc/kernel/module_64.c
+++ b/arch/powerpc/kernel/module_64.c
@@ -429,7 +429,8 @@ static unsigned long stub_for_addr(const Elf64_Shdr *sechdrs,
/* Find this stub, or if that fails, the next avail. entry */
stubs = (void *)sechdrs[me->arch.stubs_section].sh_addr;
for (i = 0; stub_func_addr(stubs[i].funcdata); i++) {
- BUG_ON(i >= num_stubs);
+ if (WARN_ON(i >= num_stubs))
+ return 0;
if (stub_func_addr(stubs[i].funcdata) == func_addr(addr))
return (unsigned long)&stubs[i];