blob: b41eb867368cdf89a746f44ccd20be5246894ea5 [file] [log] [blame]
From chrisw@hera.kernel.org Fri Apr 24 15:37:55 2009
Date: Fri, 24 Apr 2009 22:35:03 GMT
Message-Id: <200904242235.n3OMZ3Uq008747@hera.kernel.org>
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: jejb@kernel.org, stable@kernel.org
Subject: virtio-rng: Remove false BUG for spurious callbacks
From: Christian Borntraeger <borntraeger@de.ibm.com>
upstream commit: e5b89542ea18020961882228c26db3ba87f6e608
The virtio-rng drivers checks for spurious callbacks. Since
callbacks can be implemented via shared interrupts (e.g. PCI) this
could lead to guest kernel oopses with lots of virtio devices.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
drivers/char/hw_random/virtio-rng.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -37,9 +37,9 @@ static void random_recv_done(struct virt
{
int len;
- /* We never get spurious callbacks. */
+ /* We can get spurious callbacks, e.g. shared IRQs + virtio_pci. */
if (!vq->vq_ops->get_buf(vq, &len))
- BUG();
+ return;
data_left = len / sizeof(random_data[0]);
complete(&have_data);