summaryrefslogtreecommitdiff
path: root/payloads/libpayload
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2015-06-23 12:33:53 -0700
committerPatrick Georgi <pgeorgi@google.com>2015-06-30 08:09:31 +0200
commita4b718cc2d3e4e23d78d413909344bb06f31d43f (patch)
tree1be74e46c31191a168e4422b1d1be53a2bfcdde1 /payloads/libpayload
parented1a4bbb60d8a4244eb0337033cc4425fe1df492 (diff)
UDC: Correct cleaning out memory for string descriptors
BUG=chrome-os-partner:41687 BRANCH=None TEST=Compiles successfully and fastboot devices reports correct serial number even after re-connection. Change-Id: I4741a5d6333523eb47c27b4a20c4ef3f1e853d76 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 6249b1e35391550d788f56a7b3e7a49ae19f0c93 Original-Change-Id: I1348c33f354d11e3c29ccd9da9948cfbeb60aa9e Original-Signed-off-by: Furquan Shaikh <furquan@google.com> Original-Reviewed-on: https://chromium-review.googlesource.com/281192 Original-Trybot-Ready: Furquan Shaikh <furquan@chromium.org> Original-Tested-by: Furquan Shaikh <furquan@chromium.org> Original-Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Queue: Furquan Shaikh <furquan@chromium.org> Reviewed-on: http://review.coreboot.org/10687 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'payloads/libpayload')
-rw-r--r--payloads/libpayload/drivers/udc/udc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/payloads/libpayload/drivers/udc/udc.c b/payloads/libpayload/drivers/udc/udc.c
index 01aa4b1003..834a891308 100644
--- a/payloads/libpayload/drivers/udc/udc.c
+++ b/payloads/libpayload/drivers/udc/udc.c
@@ -350,7 +350,7 @@ static int setup_ep0(struct usbdev_ctrl *this, dev_req_t *dr)
int d_len = s_len * 2;
uint8_t *data = dma_malloc(d_len + 2);
- memset(data, 0, d_len);
+ memset(data, 0, d_len + 2);
data[0] = d_len + 2; // length
data[1] = 0x03; // string descriptor
int i;