From: Christian Borntraeger Date: Tue, 26 May 2009 13:46:09 +0000 (+0200) Subject: virtio: fix id_matching for virtio drivers X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c89e80168ba1ed37627fe03116b0cf8474dcb7e0;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Rusty Russell --- 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, 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