diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-30 18:09:14 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-30 18:09:14 +0300 |
commit | 29f79155b9b331167497efb0407de082d8750862 (patch) | |
tree | dde524fa03471f3a6c951e21879f36b7b952a9f8 /arch/powerpc/lib/code-patching.c | |
parent | 2e32188a66142b5b4c2dbdd6ac8dc6f54361f044 (diff) | |
parent | 17b57b1883c1285f3d0dc2266e8f79286a7bef38 (diff) | |
download | linux-29f79155b9b331167497efb0407de082d8750862.tar.xz |
Merge 4.19-rc6 into usb-next
We want the USB fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.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; |