summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/8250/serial_cs.c
diff options
context:
space:
mode:
authorZhouyang Jia <jiazhouyang09@gmail.com>2018-06-12 12:36:25 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-06-28 21:23:44 +0900
commit85c634e919bd6ef17427f26a52920aeba12e16ee (patch)
tree967a3a1f00cfbff0d8258226664191d73a96898b /drivers/tty/serial/8250/serial_cs.c
parentbe70874498f3004bd602c77e07d14f4b11acd699 (diff)
downloadlinux-85c634e919bd6ef17427f26a52920aeba12e16ee.tar.gz
linux-85c634e919bd6ef17427f26a52920aeba12e16ee.tar.bz2
linux-85c634e919bd6ef17427f26a52920aeba12e16ee.zip
drivers/tty: add error handling for pcmcia_loop_config
When pcmcia_loop_config fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling pcmcia_loop_config. Signed-off-by: Zhouyang Jia <jiazhouyang09@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/8250/serial_cs.c')
-rw-r--r--drivers/tty/serial/8250/serial_cs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/tty/serial/8250/serial_cs.c b/drivers/tty/serial/8250/serial_cs.c
index 9963a766dcfb..c8186a05a453 100644
--- a/drivers/tty/serial/8250/serial_cs.c
+++ b/drivers/tty/serial/8250/serial_cs.c
@@ -638,8 +638,10 @@ static int serial_config(struct pcmcia_device *link)
(link->has_func_id) &&
(link->socket->pcmcia_pfc == 0) &&
((link->func_id == CISTPL_FUNCID_MULTI) ||
- (link->func_id == CISTPL_FUNCID_SERIAL)))
- pcmcia_loop_config(link, serial_check_for_multi, info);
+ (link->func_id == CISTPL_FUNCID_SERIAL))) {
+ if (pcmcia_loop_config(link, serial_check_for_multi, info))
+ goto failed;
+ }
/*
* Apply any multi-port quirk.