]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
usb-linux: Don't do perror when errno is not set
authorHans de Goede <hdegoede@redhat.com>
Tue, 31 May 2011 09:35:20 +0000 (11:35 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 14 Jun 2011 10:56:49 +0000 (12:56 +0200)
Note that "op" also is not set, so before this change these error paths
would feed NULL to perror.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-linux.c

index ed1d56add7fe867b28e7837c21a954f2b716cc64..feb4d36d0bef320c12a5e3824b82b8b09dd6e2f0 100644 (file)
@@ -376,7 +376,8 @@ static int usb_host_claim_interfaces(USBHostDevice *dev, int configuration)
     i = 0;
     dev_descr_len = dev->descr[0];
     if (dev_descr_len > dev->descr_len) {
-        goto fail;
+        fprintf(stderr, "husb: update iface failed. descr too short\n");
+        return 0;
     }
 
     i += dev_descr_len;
@@ -404,7 +405,7 @@ static int usb_host_claim_interfaces(USBHostDevice *dev, int configuration)
     if (i >= dev->descr_len) {
         fprintf(stderr,
                 "husb: update iface failed. no matching configuration\n");
-        goto fail;
+        return 0;
     }
     nb_interfaces = dev->descr[i + 4];