]>
Commit | Line | Data |
---|---|---|
46eff07a GKH |
1 | From foo@baz Sat Sep 29 04:30:43 PDT 2018 |
2 | From: Zhouyang Jia <jiazhouyang09@gmail.com> | |
3 | Date: Tue, 12 Jun 2018 12:36:25 +0800 | |
4 | Subject: drivers/tty: add error handling for pcmcia_loop_config | |
5 | ||
6 | From: Zhouyang Jia <jiazhouyang09@gmail.com> | |
7 | ||
8 | [ Upstream commit 85c634e919bd6ef17427f26a52920aeba12e16ee ] | |
9 | ||
10 | When pcmcia_loop_config fails, the lack of error-handling code may | |
11 | cause unexpected results. | |
12 | ||
13 | This patch adds error-handling code after calling pcmcia_loop_config. | |
14 | ||
15 | Signed-off-by: Zhouyang Jia <jiazhouyang09@gmail.com> | |
16 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
17 | Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> | |
18 | Signed-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. |