diff options
| author | Ingo Molnar <mingo@kernel.org> | 2018-10-16 17:30:11 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2018-10-16 17:30:11 +0200 |
| commit | ec57e2f0acb01710cd465bc04495ed03a9e0fea1 (patch) | |
| tree | 9f45889ba31b750f99fd3d0b625684d9b4cd4f17 /arch/powerpc/lib/code-patching.c | |
| parent | 4766ab5677a2842834f9bc4a21587256a811531c (diff) | |
| parent | 72a9c673636b779e370983fea08e40f97039b981 (diff) | |
| download | linux-ec57e2f0acb01710cd465bc04495ed03a9e0fea1.tar.gz linux-ec57e2f0acb01710cd465bc04495ed03a9e0fea1.tar.bz2 linux-ec57e2f0acb01710cd465bc04495ed03a9e0fea1.zip | |
Merge branch 'x86/build' into locking/core, to pick up dependent patches and unify jump-label work
Signed-off-by: Ingo Molnar <mingo@kernel.org>
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, { int err; + /* Make sure we aren't patching a freed init section */ + if (init_mem_is_free && init_section_contains(exec_addr, 4)) { + pr_debug("Skipping init section patching addr: 0x%px\n", exec_addr); + return 0; + } + __put_user_size(instr, patch_addr, 4, err); if (err) return err; |
