浏览代码

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>
Christian Borntraeger 16 年之前
父节点
当前提交
c89e80168b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/virtio/virtio.c

+ 1 - 1
drivers/virtio/virtio.c

@@ -61,7 +61,7 @@ static inline int virtio_id_match(const struct virtio_device *dev,
 	if (id->device != dev->id.device)
 	if (id->device != dev->id.device)
 		return 0;
 		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
 /* This looks through all the IDs a driver claims to support.  If any of them