diff mbox

[04/14] usb-linux: Don't do perror when errno is not set

Message ID 1306834530-12763-5-git-send-email-hdegoede@redhat.com
State New
Headers show

Commit Message

Hans de Goede May 31, 2011, 9:35 a.m. UTC
Note that "op" also is not set, so before this change these error paths
would feed NULL to perror.
---
 usb-linux.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Comments

Gerd Hoffmann June 1, 2011, 11:29 a.m. UTC | #1
On 05/31/11 11:35, Hans de Goede wrote:
> Note that "op" also is not set, so before this change these error paths
> would feed NULL to perror.

Patch applied.

thanks,
   Gerd
Gerd Hoffmann June 1, 2011, 11:43 a.m. UTC | #2
On 05/31/11 11:35, Hans de Goede wrote:
> Note that "op" also is not set, so before this change these error paths
> would feed NULL to perror.

Patch applied.

thanks,
   Gerd
diff mbox

Patch

diff --git a/usb-linux.c b/usb-linux.c
index 672a589..e6c6138 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -373,7 +373,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;
@@ -401,7 +402,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];