]> xenbits.xensource.com Git - seabios.git/commitdiff
ehci: memset the qTD structures in ehci_alloc_intr_pipe
authorKevin O'Connor <kevin@koconnor.net>
Fri, 17 Jan 2014 23:43:10 +0000 (18:43 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 20 Jan 2014 17:42:43 +0000 (12:42 -0500)
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 <kevin@koconnor.net>
src/hw/usb-ehci.c

index 10c92feef5e919e0c6b850bd0f4081ccb6100c97..9d9427b6c41c13331c83ae5b8728fdf3b6941859 100644 (file)
@@ -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;