Skip to content

Commit f593839

Browse files
author
Fox Snowpatch
committed
1 parent 35d5936 commit f593839

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

arch/powerpc/kernel/kprobes.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,16 @@ void *alloc_insn_page(void)
134134
if (!page)
135135
return NULL;
136136

137-
if (strict_module_rwx_enabled())
138-
set_memory_rox((unsigned long)page, 1);
137+
if (strict_module_rwx_enabled()) {
138+
int err = set_memory_rox((unsigned long)page, 1);
139139

140+
if (err)
141+
goto error;
142+
}
140143
return page;
144+
error:
145+
module_memfree(page);
146+
return NULL;
141147
}
142148

143149
int arch_prepare_kprobe(struct kprobe *p)

0 commit comments

Comments
 (0)