* [PATCH 2/2] IOC3/IOC4: Fix error path on driver registration
@ 2009-12-03 13:39 Jean Delvare
2009-12-03 22:57 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Jean Delvare @ 2009-12-03 13:39 UTC (permalink / raw)
To: LKML; +Cc: Andrew Morton, Pat Gefre
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>
---
Note: I was not able to build-test these patches, please do.
drivers/serial/ioc4_serial.c | 16 +++++++++++++---
drivers/sn/ioc3.c | 2 +-
2 files changed, 14 insertions(+), 4 deletions(-)
--- linux-2.6.30-rc8.orig/drivers/serial/ioc4_serial.c 2009-06-04 11:41:02.000000000 +0200
+++ linux-2.6.30-rc8/drivers/serial/ioc4_serial.c 2009-06-04 12:05:51.000000000 +0200
@@ -2913,17 +2913,27 @@ static int __init ioc4_serial_init(void)
printk(KERN_WARNING
"%s: Couldn't register rs232 IOC4 serial driver\n",
__func__);
- return ret;
+ goto out;
}
if ((ret = uart_register_driver(&ioc4_uart_rs422)) < 0) {
printk(KERN_WARNING
"%s: Couldn't register rs422 IOC4 serial driver\n",
__func__);
- return ret;
+ goto out_uart_rs232;
}
/* 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)
--- linux-2.6.30-rc8.orig/drivers/sn/ioc3.c 2009-06-04 11:41:03.000000000 +0200
+++ linux-2.6.30-rc8/drivers/sn/ioc3.c 2009-06-04 12:03:26.000000000 +0200
@@ -820,7 +820,7 @@ static int __init ioc3_init(void)
{
if (ia64_platform_is("sn2"))
return pci_register_driver(&ioc3_driver);
- return 0;
+ return -ENODEV;
}
/* Module unload */
--
Jean Delvare
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 2/2] IOC3/IOC4: Fix error path on driver registration
2009-12-03 13:39 [PATCH 2/2] IOC3/IOC4: Fix error path on driver registration Jean Delvare
@ 2009-12-03 22:57 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2009-12-03 22:57 UTC (permalink / raw)
To: Jean Delvare; +Cc: LKML, Pat Gefre
On Thu, 3 Dec 2009 14:39:39 +0100
Jean Delvare <khali@linux-fr.org> wrote:
> Note: I was not able to build-test these patches, please do.
I tried, but it seems that they're finally managed to kill my ia64
toolchain:
/usr/src/25/arch/ia64/include/asm/paravirt_privop.h:409: error: impossible constraint in `asm'
oh well. If it doesn't compile I'm sure that someone will let us know.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-12-03 22:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-03 13:39 [PATCH 2/2] IOC3/IOC4: Fix error path on driver registration Jean Delvare
2009-12-03 22:57 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox