diff mbox

usb-ehci: drop assert()

Message ID 1333106781-12978-1-git-send-email-kraxel@redhat.com
State New
Headers show

Commit Message

Gerd Hoffmann March 30, 2012, 11:26 a.m. UTC
Not sure what the purpose of the assert() was, in any case it is bogous.
We can arrive there if transfer descriptors passed to us from the guest
failed to pass sanity checks, i.e. it is guest-triggerable.  We deal
with that case by resetting the host controller.  Everything is ok, no
need to throw a core dump here.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-ehci.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

Comments

Hans de Goede March 30, 2012, 2:21 p.m. UTC | #1
Looks good, ACK.

Acked-by: Hans de Goede <hdegoede@redhat.com>


On 03/30/2012 01:26 PM, Gerd Hoffmann wrote:
> Not sure what the purpose of the assert() was, in any case it is bogous.
> We can arrive there if transfer descriptors passed to us from the guest
> failed to pass sanity checks, i.e. it is guest-triggerable.  We deal
> with that case by resetting the host controller.  Everything is ok, no
> need to throw a core dump here.
>
> Signed-off-by: Gerd Hoffmann<kraxel@redhat.com>
> ---
>   hw/usb/hcd-ehci.c |    1 -
>   1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
> index e12f098..23631a4 100644
> --- a/hw/usb/hcd-ehci.c
> +++ b/hw/usb/hcd-ehci.c
> @@ -2009,7 +2009,6 @@ static void ehci_advance_state(EHCIState *ehci,
>               fprintf(stderr, "processing error - resetting ehci HC\n");
>               ehci_reset(ehci);
>               again = 0;
> -            assert(0);
>           }
>       }
>       while (again);
diff mbox

Patch

diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index e12f098..23631a4 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -2009,7 +2009,6 @@  static void ehci_advance_state(EHCIState *ehci,
             fprintf(stderr, "processing error - resetting ehci HC\n");
             ehci_reset(ehci);
             again = 0;
-            assert(0);
         }
     }
     while (again);