debug_core,kdb: fix crash when arch does not have single step
[sfrench/cifs-2.6.git] / kernel / debug / debug_core.c
index 5cb7cd1de10c7dd5b3380f69d49854cb539a4011..9ed9307615d9ab0c6132333756f9c44bc56a4bde 100644 (file)
@@ -605,13 +605,15 @@ cpu_master_loop:
                if (dbg_kdb_mode) {
                        kgdb_connected = 1;
                        error = kdb_stub(ks);
+                       if (error == -1)
+                               continue;
+                       kgdb_connected = 0;
                } else {
                        error = gdb_serial_stub(ks);
                }
 
                if (error == DBG_PASS_EVENT) {
                        dbg_kdb_mode = !dbg_kdb_mode;
-                       kgdb_connected = 0;
                } else if (error == DBG_SWITCH_CPU_EVENT) {
                        dbg_cpu_switch(cpu, dbg_switch_cpu);
                        goto cpu_loop;