lkml.org 
[lkml]   [2018]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.18 075/228] drivers/tty: add error handling for pcmcia_loop_config
    Date
    4.18-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Zhouyang Jia <jiazhouyang09@gmail.com>

    [ 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>
    ---
    drivers/tty/serial/8250/serial_cs.c | 6 ++++--
    1 file changed, 4 insertions(+), 2 deletions(-)

    --- 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_d
    (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.

    \
     
     \ /
      Last update: 2018-10-02 16:10    [W:2.152 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site