summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/kprobes.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/kprobes.c')
-rw-r--r--arch/powerpc/kernel/kprobes.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index b20ee72e87..bbca90a5e2 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -134,10 +134,16 @@ void *alloc_insn_page(void)
if (!page)
return NULL;
- if (strict_module_rwx_enabled())
- set_memory_rox((unsigned long)page, 1);
+ if (strict_module_rwx_enabled()) {
+ int err = set_memory_rox((unsigned long)page, 1);
+ if (err)
+ goto error;
+ }
return page;
+error:
+ module_memfree(page);
+ return NULL;
}
int arch_prepare_kprobe(struct kprobe *p)