Commit 9385565e authored by Jean Delvare's avatar Jean Delvare Committed by Linus Torvalds

ioc3/ioc4: fix error path on driver registration

Two IOC3 and IOC4 drivers have broken error paths on registration.  Fix
them.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Cc: Pat Gefre <pfg@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2ea5d35a
...@@ -2913,17 +2913,27 @@ static int __init ioc4_serial_init(void) ...@@ -2913,17 +2913,27 @@ static int __init ioc4_serial_init(void)
printk(KERN_WARNING printk(KERN_WARNING
"%s: Couldn't register rs232 IOC4 serial driver\n", "%s: Couldn't register rs232 IOC4 serial driver\n",
__func__); __func__);
return ret; goto out;
} }
if ((ret = uart_register_driver(&ioc4_uart_rs422)) < 0) { if ((ret = uart_register_driver(&ioc4_uart_rs422)) < 0) {
printk(KERN_WARNING printk(KERN_WARNING
"%s: Couldn't register rs422 IOC4 serial driver\n", "%s: Couldn't register rs422 IOC4 serial driver\n",
__func__); __func__);
return ret; goto out_uart_rs232;
} }
/* register with IOC4 main module */ /* register with IOC4 main module */
return ioc4_register_submodule(&ioc4_serial_submodule); ret = ioc4_register_submodule(&ioc4_serial_submodule);
if (ret)
goto out_uart_rs422;
return 0;
out_uart_rs422:
uart_unregister_driver(&ioc4_uart_rs422);
out_uart_rs232:
uart_unregister_driver(&ioc4_uart_rs232);
out:
return ret;
} }
static void __exit ioc4_serial_exit(void) static void __exit ioc4_serial_exit(void)
......
...@@ -820,7 +820,7 @@ static int __init ioc3_init(void) ...@@ -820,7 +820,7 @@ static int __init ioc3_init(void)
{ {
if (ia64_platform_is("sn2")) if (ia64_platform_is("sn2"))
return pci_register_driver(&ioc3_driver); return pci_register_driver(&ioc3_driver);
return 0; return -ENODEV;
} }
/* Module unload */ /* Module unload */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment