diff options
author | Jean Delvare <khali@linux-fr.org> | 2009-12-14 21:00:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-15 11:53:27 -0500 |
commit | 9385565e20c4acf97cd8e2fd7155750e578edcc4 (patch) | |
tree | 55ee76523bb308ef73a2f91942953db6b79fe1c9 /drivers/serial/ioc4_serial.c | |
parent | 2ea5d35a49f5c89d1d2d677fe90c71ad5a6278b6 (diff) |
ioc3/ioc4: fix error path on driver registration
Two IOC3 and IOC4 drivers have broken error paths on registration. Fix
them.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Pat Gefre <pfg@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/serial/ioc4_serial.c')
-rw-r--r-- | drivers/serial/ioc4_serial.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/serial/ioc4_serial.c b/drivers/serial/ioc4_serial.c index 902b067d7e9c..836d9ab4f729 100644 --- a/drivers/serial/ioc4_serial.c +++ b/drivers/serial/ioc4_serial.c | |||
@@ -2913,17 +2913,27 @@ static int __init ioc4_serial_init(void) | |||
2913 | printk(KERN_WARNING | 2913 | printk(KERN_WARNING |
2914 | "%s: Couldn't register rs232 IOC4 serial driver\n", | 2914 | "%s: Couldn't register rs232 IOC4 serial driver\n", |
2915 | __func__); | 2915 | __func__); |
2916 | return ret; | 2916 | goto out; |
2917 | } | 2917 | } |
2918 | if ((ret = uart_register_driver(&ioc4_uart_rs422)) < 0) { | 2918 | if ((ret = uart_register_driver(&ioc4_uart_rs422)) < 0) { |
2919 | printk(KERN_WARNING | 2919 | printk(KERN_WARNING |
2920 | "%s: Couldn't register rs422 IOC4 serial driver\n", | 2920 | "%s: Couldn't register rs422 IOC4 serial driver\n", |
2921 | __func__); | 2921 | __func__); |
2922 | return ret; | 2922 | goto out_uart_rs232; |
2923 | } | 2923 | } |
2924 | 2924 | ||
2925 | /* register with IOC4 main module */ | 2925 | /* register with IOC4 main module */ |
2926 | return ioc4_register_submodule(&ioc4_serial_submodule); | 2926 | ret = ioc4_register_submodule(&ioc4_serial_submodule); |
2927 | if (ret) | ||
2928 | goto out_uart_rs422; | ||
2929 | return 0; | ||
2930 | |||
2931 | out_uart_rs422: | ||
2932 | uart_unregister_driver(&ioc4_uart_rs422); | ||
2933 | out_uart_rs232: | ||
2934 | uart_unregister_driver(&ioc4_uart_rs232); | ||
2935 | out: | ||
2936 | return ret; | ||
2927 | } | 2937 | } |
2928 | 2938 | ||
2929 | static void __exit ioc4_serial_exit(void) | 2939 | static void __exit ioc4_serial_exit(void) |