usbip: fix error handling in stub_probe()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 28 Nov 2014 22:29:10 +0000 (01:29 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Dec 2014 00:15:02 +0000 (16:15 -0800)
commit3ff67445750a84de67faaf52c6e1895cb09f2c56
tree2a50f3fd3401948f0bcfe8ba1fa468bd2c828074
parent016040268ccafaa7ad74ef88708d54fedeb87072
usbip: fix error handling in stub_probe()

If usb_hub_claim_port() fails, no resources are deallocated and
if stub_add_files() fails, port is not released.

The patch fixes these issues and rearranges error handling code.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Valentina Manea <valentina.manea.m@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/usbip/stub_dev.c