aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/virtio
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2009-05-26 09:46:09 -0400
committerRusty Russell <rusty@rustcorp.com.au>2009-06-12 08:46:40 -0400
commitc89e80168ba1ed37627fe03116b0cf8474dcb7e0 (patch)
tree3314d284cca77dc81913877d1cf58838186e7e85 /drivers/virtio
parent594de1dd6449f79c99e1ba4577ea0e4e06e2b405 (diff)
virtio: fix id_matching for virtio drivers
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>
Diffstat (limited to 'drivers/virtio')
-rw-r--r--drivers/virtio/virtio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index bd0745250fd9..22642a255d32 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -61,7 +61,7 @@ static inline int virtio_id_match(const struct virtio_device *dev,
61 if (id->device != dev->id.device) 61 if (id->device != dev->id.device)
62 return 0; 62 return 0;
63 63
64 return id->vendor == VIRTIO_DEV_ANY_ID || id->vendor != dev->id.vendor; 64 return id->vendor == VIRTIO_DEV_ANY_ID || id->vendor == dev->id.vendor;
65} 65}
66 66
67/* This looks through all the IDs a driver claims to support. If any of them 67/* This looks through all the IDs a driver claims to support. If any of them