Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
snagrecover: utils: Fail on USB device address collisions
Sometimes, USB devices can share a single address. For vid:pid addresses, this is not uncommon, as two devices of the exact same model will most likely share the same vendor and product IDs. For USB paths, this should not happen but in some rare cases, libusb can incorrectly assign the same bus number to two separate root hubs (refer to issue #1521 in the official libusb Github repo for more details). If this happens, get_usb() should not just take the first device found and ignore the other, as this can lead to wildly unexpected behavior (e.g. snagrecover recovers one device then attempts to flash a different device). Modify get_usb() and parse_usb_addr() to fail when a USB path collision is found. Signed-off-by: Romain Gantois <romain.gantois@bootlin.com>
- Loading branch information