From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuiYy-0000Gn-7t for qemu-devel@nongnu.org; Mon, 14 Jan 2013 06:50:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TuiYs-0004EW-0e for qemu-devel@nongnu.org; Mon, 14 Jan 2013 06:50:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuiYr-0004ED-P8 for qemu-devel@nongnu.org; Mon, 14 Jan 2013 06:50:41 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0EBoeai026804 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 14 Jan 2013 06:50:41 -0500 From: Gerd Hoffmann Date: Mon, 14 Jan 2013 12:50:18 +0100 Message-Id: <1358164219-14070-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1358164219-14070-1-git-send-email-kraxel@redhat.com> References: <1358164219-14070-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 5/6] usb-host: Drop superfluous null test from usb_host_auto_scan() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Markus Armbruster , Gerd Hoffmann From: Markus Armbruster Coverity points out that port is later passed to usb_host_open(), which dereferences it. It actually can't be null: it always points to usb_host_scan()'s auto port[]. Drop the superfluous port == NULL test. Signed-off-by: Markus Armbruster Signed-off-by: Gerd Hoffmann --- hw/usb/host-linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/host-linux.c b/hw/usb/host-linux.c index e8e6a42..a498840 100644 --- a/hw/usb/host-linux.c +++ b/hw/usb/host-linux.c @@ -1760,7 +1760,7 @@ static int usb_host_auto_scan(void *opaque, int bus_num, if (f->addr > 0 && f->addr != addr) { continue; } - if (f->port != NULL && (port == NULL || strcmp(f->port, port) != 0)) { + if (f->port != NULL && strcmp(f->port, port) != 0) { continue; } -- 1.7.9.7