• Pan Bian's avatar
    USB: serial: kl5kusb105: abort on open exception path · 3c3dd1e0
    Pan Bian authored
    Function klsi_105_open() calls usb_control_msg() (to "enable read") and
    checks its return value. When the return value is unexpected, it only
    assigns the error code to the return variable retval, but does not
    terminate the exception path. This patch fixes the bug by inserting
    "goto err_generic_close;" when the call to usb_control_msg() fails.
    
    Fixes: 1da177e4 ("Linux-2.6.12-rc2")
    Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
    [johan: rebase on prerequisite fix and amend commit message]
    Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
    3c3dd1e0
kl5kusb105.c 16.7 KB