OSDN Git Service

usbip: usbip_detach: Fix memory, udev context and udev leak
authorShuah Khan (Samsung OSG) <shuah@kernel.org>
Tue, 29 May 2018 22:13:03 +0000 (16:13 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:55:15 +0000 (07:55 +0200)
commitce28cf5fb47f149e30176b7d6de161ebf1c6c6a1
tree7f25e2c0f07e04cbdbe29bfa9b507fe0dbcd6dc2
parent9e222d7ca5d535d524e92ff303b6f1e61f5ec4d5
usbip: usbip_detach: Fix memory, udev context and udev leak

[ Upstream commit d179f99a651685b19333360e6558110da2fe9bd7 ]

detach_port() fails to call usbip_vhci_driver_close() from its error
path after usbip_vhci_detach_device() returns failure, leaking memory
allocated in usbip_vhci_driver_open() and holding udev_context and udev
references. Fix it to call usbip_vhci_driver_close().

Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
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>
tools/usb/usbip/src/usbip_detach.c