From patchwork Thu Jan 10 13:33:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 211005 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 27C0D2C0341 for ; Fri, 11 Jan 2013 00:33:53 +1100 (EST) Received: from localhost ([::1]:53028 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtIGV-0001My-8A for incoming@patchwork.ozlabs.org; Thu, 10 Jan 2013 08:33:51 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtIGF-0001Dh-Ln for qemu-devel@nongnu.org; Thu, 10 Jan 2013 08:33:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtIGA-0002CK-EW for qemu-devel@nongnu.org; Thu, 10 Jan 2013 08:33:35 -0500 Received: from oxygen.pond.sub.org ([2a01:4f8:121:10e4::3]:47364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtIGA-0002Bv-4o for qemu-devel@nongnu.org; Thu, 10 Jan 2013 08:33:30 -0500 Received: from blackfin.pond.sub.org (p5B32A660.dip.t-dialin.net [91.50.166.96]) by oxygen.pond.sub.org (Postfix) with ESMTPA id 28E799FE68 for ; Thu, 10 Jan 2013 14:33:26 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 84249200AA; Thu, 10 Jan 2013 14:33:25 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 10 Jan 2013 14:33:24 +0100 Message-Id: <1357824805-31574-3-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1357824805-31574-1-git-send-email-armbru@redhat.com> References: <1357824805-31574-1-git-send-email-armbru@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:4f8:121:10e4::3 Cc: kraxel@redhat.com Subject: [Qemu-devel] [PATCH 2/3] usb-host: Drop superfluous null test from usb_host_auto_scan() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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 669fbd2..ea2179f 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; }