]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
usbip: usbip_host: run rebind from exit when module is removed
authorShuah Khan (Samsung OSG) <shuah@kernel.org>
Mon, 30 Apr 2018 22:17:20 +0000 (16:17 -0600)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:27:07 +0000 (12:27 +0200)
commitf85a43b30a2167221deea52af6f77dad48e2364d
treed1e7339b47dd2a5e8d5e968425c2ef2845210b4b
parent7f36a83df6d4fabe39ba597a4eef5ca1f5bbda99
usbip: usbip_host: run rebind from exit when module is removed

BugLink: http://bugs.launchpad.net/bugs/1782846
commit 7510df3f29d44685bab7b1918b61a8ccd57126a9 upstream.

After removing usbip_host module, devices it releases are left without
a driver. For example, when a keyboard or a mass storage device are
bound to usbip_host when it is removed, these devices are no longer
bound to any driver.

Fix it to run device_attach() from the module exit routine to restore
the devices to their original drivers. This includes cleanup changes
and moving device_attach() code to a common routine to be called from
rebind_store() and usbip_host_exit().

Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/usb/usbip/stub_dev.c
drivers/usb/usbip/stub_main.c