From b482ce4eeb13188daf02bc642054ed44b175b836 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 23 Jun 2011 12:42:27 -0300 Subject: [RHEL6 qemu-kvm PATCH 111/115] usb-linux: Don't try to open the same device twice RH-Author: Gerd Hoffmann Message-id: <1308832951-8995-112-git-send-email-kraxel@redhat.com> Patchwork-id: 27910 O-Subject: [RHEL-6.2 kvm PATCH 111/115] usb-linux: Don't try to open the same device twice Bugzilla: 561414 632299 645351 711354 RH-Acked-by: Hans de Goede RH-Acked-by: Jes Sorensen From: Hans de Goede If a user wants to redirect 2 identical usb sticks, in theory this is possible by doing: usb_add host:1234:5678 usb_add host:1234:5678 But this will lead to us trying to open the first stick twice, since we don't break the loop after having found a match in our filter list, so the next' filter list entry will result in us trying to open the same device again. Fix this by adding the missing break. Signed-off-by: Gerd Hoffmann (cherry picked from commit 97f8616648b426f35621d7f9165c304a3416cd62) --- usb-linux.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) Signed-off-by: Eduardo Habkost --- usb-linux.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/usb-linux.c b/usb-linux.c index 971aa9a..e48ab96 100644 --- a/usb-linux.c +++ b/usb-linux.c @@ -1637,6 +1637,7 @@ static int usb_host_auto_scan(void *opaque, int bus_num, int addr, char *port, return 0; usb_host_open(s, bus_num, addr, port, product_name, speed); + break; } return 0; -- 1.7.3.2