All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] Don't panic the kernel when cyclades tty
@ 2007-02-11 13:57 Andi Kleen
  0 siblings, 0 replies; only message in thread
From: Andi Kleen @ 2007-02-11 13:57 UTC (permalink / raw)
  To: kernel-janitors


I noticed this while grepping for something. There is no reason to panic
the kernel when a tty driver cannot be initialized.
Just error out in this case, no need to panic.

BTW there seem to be more bogus panics in a few drivers. Perhaps that
would be a fruitful target for some janitor activity (mailing list cc'ed) 

Signed-off-by: Andi Kleen <ak@suse.de

Index: linux-2.6.20-git6-hack/drivers/char/cyclades.c
=================================--- linux-2.6.20-git6-hack.orig/drivers/char/cyclades.c
+++ linux-2.6.20-git6-hack/drivers/char/cyclades.c
@@ -5346,8 +5346,11 @@ static int __init cy_init(void)
 	cy_serial_driver->flags = TTY_DRIVER_REAL_RAW;
 	tty_set_operations(cy_serial_driver, &cy_ops);
 
-	if (tty_register_driver(cy_serial_driver))
-		panic("Couldn't register Cyclades serial driver\n");
+	if (tty_register_driver(cy_serial_driver)) {
+		printk(KERN_ERR "Couldn't register Cyclades serial driver\n");
+		put_tty_driver(cy_serial_driver);
+		return -EIO;
+	}
 
 	for (i = 0; i < NR_CARDS; i++) {
 		/* base_addr=0 indicates board not found */
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-11 13:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-11 13:57 [KJ] [PATCH] Don't panic the kernel when cyclades tty Andi Kleen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.