[PATCH v3 2/2] usbip: tools: replace faulty rebind_store with drivers_probe
From: Jeffin Philip
Date: Tue Aug 11 2026 - 12:22:32 EST
unbind_device() currently unbinds and then uses rebind_store
to rebind the device back to the usb driver. This is already
possible with the safer drivers_probe rather than the faulty
rebind_store. Fix this by referencing drivers_probe rather
than rebind_store.
Fixes: a46034ca57ed ("staging: usbip: trigger driver probing after unbinding from usbip-host")
Signed-off-by: Jeffin Philip <jeffinphilip14@xxxxxxxxx>
---
tools/usb/usbip/src/usbip_unbind.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/tools/usb/usbip/src/usbip_unbind.c b/tools/usb/usbip/src/usbip_unbind.c
index 66a44d4a0d56..242280cec452 100644
--- a/tools/usb/usbip/src/usbip_unbind.c
+++ b/tools/usb/usbip/src/usbip_unbind.c
@@ -34,7 +34,7 @@ static int unbind_device(char *busid)
char unbind_attr_name[] = "unbind";
char unbind_attr_path[SYSFS_PATH_MAX];
- char rebind_attr_name[] = "rebind";
+ char rebind_attr_name[] = "drivers_probe";
char rebind_attr_path[SYSFS_PATH_MAX];
struct udev *udev;
@@ -77,9 +77,8 @@ static int unbind_device(char *busid)
}
/* Trigger new probing. */
- snprintf(rebind_attr_path, sizeof(unbind_attr_path), "%s/%s/%s/%s/%s/%s",
- SYSFS_MNT_PATH, SYSFS_BUS_NAME, bus_type, SYSFS_DRIVERS_NAME,
- USBIP_HOST_DRV_NAME, rebind_attr_name);
+ snprintf(rebind_attr_path, sizeof(rebind_attr_path), "%s/%s/%s/%s",
+ SYSFS_MNT_PATH, SYSFS_BUS_NAME, bus_type, rebind_attr_name);
rc = write_sysfs_attribute(rebind_attr_path, busid, strlen(busid));
if (rc < 0) {
--
2.55.0