提交 c89e8016 编写于 作者: C Christian Borntraeger 提交者: Rusty Russell

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: NChristian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
上级 594de1dd
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册