Skip to content

Commit

Permalink
virtio: fix id_matching for virtio drivers
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
borntraeger authored and rustyrussell committed Jun 12, 2009
1 parent 594de1d commit c89e801
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/virtio/virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c89e801

Please sign in to comment.