Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e180f16 authored by Shuah Khan (Samsung OSG)'s avatar Shuah Khan (Samsung OSG) Committed by Greg Kroah-Hartman
Browse files

usbip: usbip_host: delete device from busid_table after rebind



Device is left in the busid_table after unbind and rebind. Rebind
initiates usb bus scan and the original driver claims the device.
After rescan the device should be deleted from the busid_table as
it no longer belongs to usbip_host.

Fix it to delete the device after device_attach() succeeds.

Signed-off-by: default avatarShuah Khan (Samsung OSG) <shuah@kernel.org>
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 28b68acc
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -186,6 +186,9 @@ static ssize_t rebind_store(struct device_driver *dev, const char *buf,
	if (!bid)
		return -ENODEV;

	/* mark the device for deletion so probe ignores it during rescan */
	bid->status = STUB_BUSID_OTHER;

	/* device_attach() callers should hold parent lock for USB */
	if (bid->udev->dev.parent)
		device_lock(bid->udev->dev.parent);
@@ -197,6 +200,9 @@ static ssize_t rebind_store(struct device_driver *dev, const char *buf,
		return ret;
	}

	/* delete device from busid_table */
	del_match_busid((char *) buf);

	return count;
}