Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Zhouyang Jia and committed by
Greg Kroah-Hartman
85c634e9 be708744

+4 -2
+4 -2
drivers/tty/serial/8250/serial_cs.c
··· 638 638 (link->has_func_id) && 639 639 (link->socket->pcmcia_pfc == 0) && 640 640 ((link->func_id == CISTPL_FUNCID_MULTI) || 641 - (link->func_id == CISTPL_FUNCID_SERIAL))) 642 - pcmcia_loop_config(link, serial_check_for_multi, info); 641 + (link->func_id == CISTPL_FUNCID_SERIAL))) { 642 + if (pcmcia_loop_config(link, serial_check_for_multi, info)) 643 + goto failed; 644 + } 643 645 644 646 /* 645 647 * Apply any multi-port quirk.