Skip to content

Commit

Permalink
usb-linux: fix /proc/bus/usb/devices scan
Browse files Browse the repository at this point in the history
Commit 0c402e5 is incomplete
and misses one of the two function pointer calls in
usb_host_scan_dev().  Add the additional port handling logic
to the other call too.

Spotted by Coverity.

Cc: Markus Armbruster <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
  • Loading branch information
kraxel committed Nov 21, 2011
1 parent b246721 commit 0cd0fd0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion usb-linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,12 @@ static int usb_host_scan_dev(void *opaque, USBScanFunc *func)
if (line[0] == 'T' && line[1] == ':') {
if (device_count && (vendor_id || product_id)) {
/* New device. Add the previously discovered device. */
ret = func(opaque, bus_num, addr, 0, class_id, vendor_id,
if (port > 0) {
snprintf(buf, sizeof(buf), "%d", port);
} else {
snprintf(buf, sizeof(buf), "?");
}
ret = func(opaque, bus_num, addr, buf, class_id, vendor_id,
product_id, product_name, speed);
if (ret) {
goto the_end;
Expand Down

0 comments on commit 0cd0fd0

Please sign in to comment.