]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.160/drivers-tty-add-error-handling-for-pcmcia_loop_config.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.160 / drivers-tty-add-error-handling-for-pcmcia_loop_config.patch
CommitLineData
46eff07a
GKH
1From foo@baz Sat Sep 29 04:30:43 PDT 2018
2From: Zhouyang Jia <jiazhouyang09@gmail.com>
3Date: Tue, 12 Jun 2018 12:36:25 +0800
4Subject: drivers/tty: add error handling for pcmcia_loop_config
5
6From: Zhouyang Jia <jiazhouyang09@gmail.com>
7
8[ Upstream commit 85c634e919bd6ef17427f26a52920aeba12e16ee ]
9
10When pcmcia_loop_config fails, the lack of error-handling code may
11cause unexpected results.
12
13This patch adds error-handling code after calling pcmcia_loop_config.
14
15Signed-off-by: Zhouyang Jia <jiazhouyang09@gmail.com>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19---
20 drivers/tty/serial/8250/serial_cs.c | 6 ++++--
21 1 file changed, 4 insertions(+), 2 deletions(-)
22
23--- a/drivers/tty/serial/8250/serial_cs.c
24+++ b/drivers/tty/serial/8250/serial_cs.c
25@@ -629,8 +629,10 @@ static int serial_config(struct pcmcia_d
26 (link->has_func_id) &&
27 (link->socket->pcmcia_pfc == 0) &&
28 ((link->func_id == CISTPL_FUNCID_MULTI) ||
29- (link->func_id == CISTPL_FUNCID_SERIAL)))
30- pcmcia_loop_config(link, serial_check_for_multi, info);
31+ (link->func_id == CISTPL_FUNCID_SERIAL))) {
32+ if (pcmcia_loop_config(link, serial_check_for_multi, info))
33+ goto failed;
34+ }
35
36 /*
37 * Apply any multi-port quirk.