From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTZ6T-0008LU-0n for qemu-devel@nongnu.org; Mon, 06 Jun 2011 08:40:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QTZ6P-0005Xl-Fz for qemu-devel@nongnu.org; Mon, 06 Jun 2011 08:40:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTZ6O-0005XV-O8 for qemu-devel@nongnu.org; Mon, 06 Jun 2011 08:40:17 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p56CeFM6021387 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 6 Jun 2011 08:40:16 -0400 From: Gerd Hoffmann Date: Mon, 6 Jun 2011 14:39:12 +0200 Message-Id: <1307363962-27223-22-git-send-email-kraxel@redhat.com> In-Reply-To: <1307363962-27223-1-git-send-email-kraxel@redhat.com> References: <1307363962-27223-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 21/31] usb-linux: Don't do perror when errno is not set List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hans de Goede , Gerd Hoffmann From: Hans de Goede Note that "op" also is not set, so before this change these error paths would feed NULL to perror. Signed-off-by: Gerd Hoffmann --- usb-linux.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/usb-linux.c b/usb-linux.c index 03e43c0..4c6c284 100644 --- a/usb-linux.c +++ b/usb-linux.c @@ -377,7 +377,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; @@ -405,7 +406,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]; -- 1.7.1