Skip to content

Commit

Permalink
usb-host: Drop superfluous null test from usb_host_auto_scan()
Browse files Browse the repository at this point in the history
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 <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
  • Loading branch information
Markus Armbruster authored and kraxel committed Jan 14, 2013
1 parent cc8d2b6 commit 4663530
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/usb/host-linux.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4663530

Please sign in to comment.