|
@@ -127,10 +127,23 @@ int read_attr_value(struct udev_device *dev, const char *name,
|
|
goto err;
|
|
goto err;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* The client chooses the device configuration
|
|
|
|
+ * when attaching it so right after being bound
|
|
|
|
+ * to usbip-host on the server the device will
|
|
|
|
+ * have no configuration.
|
|
|
|
+ * Therefore, attributes such as bConfigurationValue
|
|
|
|
+ * and bNumInterfaces will not exist and sscanf will
|
|
|
|
+ * fail. Check for these cases and don't treat them
|
|
|
|
+ * as errors.
|
|
|
|
+ */
|
|
|
|
+
|
|
ret = sscanf(attr, format, &num);
|
|
ret = sscanf(attr, format, &num);
|
|
if (ret < 1) {
|
|
if (ret < 1) {
|
|
- err("sscanf failed");
|
|
|
|
- goto err;
|
|
|
|
|
|
+ if (strcmp(name, "bConfigurationValue") &&
|
|
|
|
+ strcmp(name, "bNumInterfaces")) {
|
|
|
|
+ err("sscanf failed for attribute %s", name);
|
|
|
|
+ goto err;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
err:
|
|
err:
|