virtio: fix id_matching for virtio drivers
authorChristian Borntraeger <borntraeger@de.ibm.com>
Tue, 26 May 2009 13:46:09 +0000 (15:46 +0200)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 12 Jun 2009 12:46:40 +0000 (22:16 +0930)
This bug never appeared, since all current virtio drivers use
VIRTIO_DEV_ANY_ID for the vendor field. If a real vendor would be used,
the check in virtio_id_match is wrong - it returns 0 if
id->vendor == dev->id.vendor.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/virtio/virtio.c

index bd07452..22642a2 100644 (file)
@@ -61,7 +61,7 @@ static inline int virtio_id_match(const struct virtio_device *dev,
        if (id->device != dev->id.device)
                return 0;
 
-       return id->vendor == VIRTIO_DEV_ANY_ID || id->vendor != dev->id.vendor;
+       return id->vendor == VIRTIO_DEV_ANY_ID || id->vendor == dev->id.vendor;
 }
 
 /* This looks through all the IDs a driver claims to support.  If any of them