hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/arch/powerpc/kernel/ptrace/ptrace-view.c
....@@ -298,6 +298,9 @@
298298 static int ppr_get(struct task_struct *target, const struct user_regset *regset,
299299 struct membuf to)
300300 {
301
+ if (!target->thread.regs)
302
+ return -EINVAL;
303
+
301304 return membuf_write(&to, &target->thread.regs->ppr, sizeof(u64));
302305 }
303306
....@@ -305,6 +308,9 @@
305308 unsigned int pos, unsigned int count, const void *kbuf,
306309 const void __user *ubuf)
307310 {
311
+ if (!target->thread.regs)
312
+ return -EINVAL;
313
+
308314 return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
309315 &target->thread.regs->ppr, 0, sizeof(u64));
310316 }