Merge branch 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
[linux-3.10.git] / drivers / tty / serial / kgdboc.c
index ebabf92..c0b3343 100644 (file)
@@ -145,6 +145,8 @@ __setup("kgdboc=", kgdboc_option_setup);
 
 static void cleanup_kgdboc(void)
 {
+       if (kgdb_unregister_nmi_console())
+               return;
        kgdboc_unregister_kbd();
        if (configured == 1)
                kgdb_unregister_io_module(&kgdboc_io_ops);
@@ -198,11 +200,18 @@ do_register:
        if (err)
                goto noconfig;
 
+       err = kgdb_register_nmi_console();
+       if (err)
+               goto nmi_con_failed;
+
        configured = 1;
 
        return 0;
 
+nmi_con_failed:
+       kgdb_unregister_io_module(&kgdboc_io_ops);
 noconfig:
+       kgdboc_unregister_kbd();
        config[0] = 0;
        configured = 0;
        cleanup_kgdboc();