diff options
Diffstat (limited to 'arch/powerpc/lib/code-patching.c')
-rw-r--r-- | arch/powerpc/lib/code-patching.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c index 850f3b8f4da5..6ae2777c220d 100644 --- a/arch/powerpc/lib/code-patching.c +++ b/arch/powerpc/lib/code-patching.c | |||
@@ -28,6 +28,12 @@ static int __patch_instruction(unsigned int *exec_addr, unsigned int instr, | |||
28 | { | 28 | { |
29 | int err; | 29 | int err; |
30 | 30 | ||
31 | /* Make sure we aren't patching a freed init section */ | ||
32 | if (init_mem_is_free && init_section_contains(exec_addr, 4)) { | ||
33 | pr_debug("Skipping init section patching addr: 0x%px\n", exec_addr); | ||
34 | return 0; | ||
35 | } | ||
36 | |||
31 | __put_user_size(instr, patch_addr, 4, err); | 37 | __put_user_size(instr, patch_addr, 4, err); |
32 | if (err) | 38 | if (err) |
33 | return err; | 39 | return err; |