From patchwork Thu Jan 10 13:33:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/3] usb-host: Drop superfluous null test from usb_host_auto_scan() Date: Thu, 10 Jan 2013 03:33:24 -0000 From: Markus Armbruster X-Patchwork-Id: 211005 Message-Id: <1357824805-31574-3-git-send-email-armbru@redhat.com> To: qemu-devel@nongnu.org Cc: kraxel@redhat.com 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; }