mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 07:01:23 +00:00
powerpc/hw_breakpoints: Fix incorrect pointer access
If arch_validate_hwbkpt_settings() fails, bp->ctx won't be valid and the kernel panics. Add a check to fix this. Reported-by: Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
parent
1d5a436d2c
commit
ac84aa2b3b
1 changed files with 1 additions and 1 deletions
|
@ -111,7 +111,7 @@ void arch_unregister_hw_breakpoint(struct perf_event *bp)
|
||||||
* and the single_step_dabr_instruction(), then cleanup the breakpoint
|
* and the single_step_dabr_instruction(), then cleanup the breakpoint
|
||||||
* restoration variables to prevent dangling pointers.
|
* restoration variables to prevent dangling pointers.
|
||||||
*/
|
*/
|
||||||
if (bp->ctx->task)
|
if (bp->ctx && bp->ctx->task)
|
||||||
bp->ctx->task->thread.last_hit_ubp = NULL;
|
bp->ctx->task->thread.last_hit_ubp = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue