]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
USB: serial: kl5kusb105: abort on open exception path
authorPan Bian <bianpan2016@163.com>
Tue, 29 Nov 2016 15:55:02 +0000 (16:55 +0100)
committerJohan Hovold <johan@kernel.org>
Wed, 30 Nov 2016 09:54:30 +0000 (10:54 +0100)
commit3c3dd1e058cb01e835dcade4b54a6f13ffaeaf7c
treea8ddafab87aeaf49313529c56f9030ae5d13f575
parent6774d5f53271d5f60464f824748995b71da401ab
USB: serial: kl5kusb105: abort on open exception path

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: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Pan Bian <bianpan2016@163.com>
[johan: rebase on prerequisite fix and amend commit message]
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/kl5kusb105.c