All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
	Christian Borntraeger <borntraeger@de.ibm.com>
Subject: [patch 1/2] virtio: fix id_matching for virtio drivers
Date: Tue, 26 May 2009 15:46:09 +0200	[thread overview]
Message-ID: <20090526135140.796154000@de.ibm.com> (raw)
In-Reply-To: 20090526134608.545964000@de.ibm.com

[-- Attachment #1: virtio_id_fix.patch --]
[-- Type: text/plain, Size: 960 bytes --]

From: Christian Borntraeger <borntraeger@de.ibm.com>

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>
---
 drivers/virtio/virtio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-next/drivers/virtio/virtio.c
===================================================================
--- linux-next.orig/drivers/virtio/virtio.c
+++ linux-next/drivers/virtio/virtio.c
@@ -61,7 +61,7 @@ static inline int virtio_id_match(const 
 	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


  reply	other threads:[~2009-05-26 13:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-26 13:46 [patch 0/2] Fix and enhance virtio device id matching Christian Borntraeger
2009-05-26 13:46 ` Christian Borntraeger [this message]
2009-05-26 13:46 ` [patch 1/2] virtio: fix id_matching for virtio drivers Christian Borntraeger
2009-05-26 13:46 ` [patch 2/2] virtio: enhance " Christian Borntraeger
2009-05-26 13:46 ` Christian Borntraeger
2009-05-27  2:41 ` [patch 0/2] Fix and enhance virtio device id matching Rusty Russell
2009-05-27  2:41 ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090526135140.796154000@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.