diff mbox

[1/2] ehci: Fix error detection when registering a new list base address

Message ID 1273458728-24918-2-git-send-email-vincent.palatin_qemu@m4x.org
State New
Headers show

Commit Message

Vincent Palatin May 10, 2010, 2:32 a.m. UTC
We must check against the current running command not the list address.

Signed-off-by: Vincent Palatin <vincent.palatin_qemu@m4x.org>
---
 hw/usb-ehci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
index 8be0780..e724653 100644
--- a/hw/usb-ehci.c
+++ b/hw/usb-ehci.c
@@ -774,7 +774,7 @@  static void ehci_mem_writel(void *ptr, target_phys_addr_t addr, uint32_t val)
         break;
 
     case PERIODICLISTBASE:
-        if (val & USBCMD_PSE) {
+        if (s->usbcmd & USBCMD_PSE) {
             fprintf(stderr, "Guest OS should not be setting the periodic"
                    " list base register while periodic schedule is enabled\n");
             return;
@@ -783,7 +783,7 @@  static void ehci_mem_writel(void *ptr, target_phys_addr_t addr, uint32_t val)
         break;
 
     case ASYNCLISTADDR:
-        if (val & USBCMD_ASE) {
+        if (s->usbcmd & USBCMD_ASE) {
             fprintf(stderr, "Guest OS should not be setting the async list"
                    " address register while async schedule is enabled\n");
             return;