[PATCH] Fix null dereference when using early kgdb
From: Jason Wessel
Date: Fri Sep 24 2010 - 16:21:11 EST
Signed-off-by: Jason Wessel <jason.wessel@xxxxxxxxxxxxx>
---
kernel/hw_breakpoint.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/hw_breakpoint.c b/kernel/hw_breakpoint.c
index 3b714e8..3c7ccdf 100644
--- a/kernel/hw_breakpoint.c
+++ b/kernel/hw_breakpoint.c
@@ -213,7 +213,7 @@ toggle_bp_slot(struct perf_event *bp, bool enable, enum bp_type_idx type,
int weight)
{
int cpu = bp->cpu;
- struct task_struct *tsk = bp->ctx->task;
+ struct task_struct *tsk = bp->ctx ? bp->ctx->task : NULL;
/* Pinned counter cpu profiling */
if (!tsk) {
--
1.6.3.3
--------------080701090502060403010908--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/