summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/sunsab.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--drivers/tty/serial/sunsab.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/tty/serial/sunsab.c b/drivers/tty/serial/sunsab.c
index 72131b5e1..beca02c30 100644
--- a/drivers/tty/serial/sunsab.c
+++ b/drivers/tty/serial/sunsab.c
@@ -1140,7 +1140,13 @@ static int __init sunsab_init(void)
}
}
- return platform_driver_register(&sab_driver);
+ err = platform_driver_register(&sab_driver);
+ if (err) {
+ kfree(sunsab_ports);
+ sunsab_ports = NULL;
+ }
+
+ return err;
}
static void __exit sunsab_exit(void)