From: Kevin O'Connor Date: Fri, 17 Jan 2014 23:43:10 +0000 (-0500) Subject: ehci: memset the qTD structures in ehci_alloc_intr_pipe X-Git-Tag: rel-1.7.5-rc1~82 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7d2fd49d9244f70e65210753686ca7c1687a3a78;p=seabios.git ehci: memset the qTD structures in ehci_alloc_intr_pipe The qTD structures were not being cleared in ehci_alloc_intr_pipe() and it was possible that garbage could have been in some of the fields. Also, memset the data array for sanity purposes. A similar fix is in the Chromium seabios repo (3e711dc261). Signed-off-by: Kevin O'Connor --- diff --git a/src/hw/usb-ehci.c b/src/hw/usb-ehci.c index 10c92fe..9d9427b 100644 --- a/src/hw/usb-ehci.c +++ b/src/hw/usb-ehci.c @@ -409,6 +409,8 @@ ehci_alloc_intr_pipe(struct usbdevice_s *usbdev goto fail; } memset(pipe, 0, sizeof(*pipe)); + memset(tds, 0, sizeof(*tds) * count); + memset(data, 0, maxpacket * count); ehci_desc2pipe(pipe, usbdev, epdesc); pipe->next_td = pipe->tds = tds; pipe->data = data;