[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 8/8] usb-linux: fix /proc/bus/usb/devices scan
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 8/8] usb-linux: fix /proc/bus/usb/devices scan |
Date: |
Mon, 21 Nov 2011 14:40:02 +0100 |
Commit 0c402e5abb8c2755390eee864b43a98280fc2453 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 <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
usb-linux.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/usb-linux.c b/usb-linux.c
index f086d57..d4426ea 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -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;
--
1.7.1
- [Qemu-devel] [PULL 1.0] usb patch queue (with scsi bits)., Gerd Hoffmann, 2011/11/21
- [Qemu-devel] [PATCH 4/8] usb-storage: drop result from device state., Gerd Hoffmann, 2011/11/21
- [Qemu-devel] [PATCH 7/8] ehci: add assert, Gerd Hoffmann, 2011/11/21
- [Qemu-devel] [PATCH 3/8] usb-storage: drop tag from device state., Gerd Hoffmann, 2011/11/21
- [Qemu-devel] [PATCH 2/8] usb-storage: fill status in complete callback., Gerd Hoffmann, 2011/11/21
- [Qemu-devel] [PATCH 5/8] scsi-disk: don't call scsi_req_complete twice., Gerd Hoffmann, 2011/11/21
- [Qemu-devel] [PATCH 8/8] usb-linux: fix /proc/bus/usb/devices scan,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 1/8] usb-storage: move status debug message to usb_msd_send_status., Gerd Hoffmann, 2011/11/21
- [Qemu-devel] [PATCH 6/8] usb-storage: don't try to send the status early., Gerd Hoffmann, 2011/11/21