diff options
author | Zhouyang Jia <jiazhouyang09@gmail.com> | 2018-06-12 07:36:25 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-10-04 03:00:51 +0300 |
commit | 0091a4ede7834c92751cb56fe4a9bc3b62d347ed (patch) | |
tree | 8f43b1aef0f10e3d6f62c82fe57d7e9ed2dc1ce2 | |
parent | 3af342f5ddbd2ee31aa9e3ae2c50869f304ffe4d (diff) | |
download | linux-0091a4ede7834c92751cb56fe4a9bc3b62d347ed.tar.xz |
drivers/tty: add error handling for pcmcia_loop_config
[ Upstream commit 85c634e919bd6ef17427f26a52920aeba12e16ee ]
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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/8250/serial_cs.c | 6 |
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 933c2688dd7e..8106353ce7aa 100644 --- a/drivers/tty/serial/8250/serial_cs.c +++ b/drivers/tty/serial/8250/serial_cs.c @@ -637,8 +637,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. |