hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/sh/kernel/ftrace.c
....@@ -119,7 +119,7 @@
119119 * But if one were to fail, then they all should, and if one were
120120 * to succeed, then they all should.
121121 */
122
- mod_code_status = probe_kernel_write(mod_code_ip, mod_code_newcode,
122
+ mod_code_status = copy_to_kernel_nofault(mod_code_ip, mod_code_newcode,
123123 MCOUNT_INSN_SIZE);
124124
125125 /* if we fail, then kill any new writers */
....@@ -203,7 +203,7 @@
203203 */
204204
205205 /* read the text we want to modify */
206
- if (probe_kernel_read(replaced, (void *)ip, MCOUNT_INSN_SIZE))
206
+ if (copy_from_kernel_nofault(replaced, (void *)ip, MCOUNT_INSN_SIZE))
207207 return -EFAULT;
208208
209209 /* Make sure it is what we expect it to be */
....@@ -268,7 +268,7 @@
268268 {
269269 unsigned char code[MCOUNT_INSN_SIZE];
270270
271
- if (probe_kernel_read(code, (void *)ip, MCOUNT_INSN_SIZE))
271
+ if (copy_from_kernel_nofault(code, (void *)ip, MCOUNT_INSN_SIZE))
272272 return -EFAULT;
273273
274274 if (old_addr != __raw_readl((unsigned long *)code))