diff options
| author | Ingo Molnar <[email protected]> | 2018-10-02 07:50:34 +0000 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2018-10-02 07:50:34 +0000 |
| commit | 97e831e13015045c098e1187f9b8b8e9bace9413 (patch) | |
| tree | 26c4a34a290841a140007bf10a45798b8ea49c44 /arch/powerpc/lib/code-patching.c | |
| parent | Merge tag 'perf-core-for-mingo-4.20-20180924' of git://git.kernel.org/pub/scm... (diff) | |
| parent | perf/x86/amd/uncore: Set ThreadMask and SliceMask for L3 Cache perf events (diff) | |
| download | kernel-97e831e13015045c098e1187f9b8b8e9bace9413.tar.gz kernel-97e831e13015045c098e1187f9b8b8e9bace9413.zip | |
Merge branch 'perf/urgent' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <[email protected]>
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; |
