Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac84aa2b authored by Naveen N. Rao's avatar Naveen N. Rao Committed by Benjamin Herrenschmidt
Browse files

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: default avatarEdjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
Signed-off-by: default avatarNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 1d5a436d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ void arch_unregister_hw_breakpoint(struct perf_event *bp)
	 * and the single_step_dabr_instruction(), then cleanup the breakpoint
	 * restoration variables to prevent dangling pointers.
	 */
	if (bp->ctx->task)
	if (bp->ctx && bp->ctx->task)
		bp->ctx->task->thread.last_hit_ubp = NULL;
}