diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2014-01-17 18:43:10 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2014-01-20 12:42:43 -0500 |
commit | 7d2fd49d9244f70e65210753686ca7c1687a3a78 (patch) | |
tree | 4585d866268b335101b963a0c29d6d7bc3d90c78 | |
parent | 5f2d17d35b2339526f3b3d580b279ea78e406a25 (diff) | |
download | seabios-7d2fd49d9244f70e65210753686ca7c1687a3a78.zip seabios-7d2fd49d9244f70e65210753686ca7c1687a3a78.tar.gz seabios-7d2fd49d9244f70e65210753686ca7c1687a3a78.tar.bz2 |
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 <kevin@koconnor.net>
-rw-r--r-- | src/hw/usb-ehci.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; |