From a4b718cc2d3e4e23d78d413909344bb06f31d43f Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Tue, 23 Jun 2015 12:33:53 -0700 Subject: 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 Original-Commit-Id: 6249b1e35391550d788f56a7b3e7a49ae19f0c93 Original-Change-Id: I1348c33f354d11e3c29ccd9da9948cfbeb60aa9e Original-Signed-off-by: Furquan Shaikh Original-Reviewed-on: https://chromium-review.googlesource.com/281192 Original-Trybot-Ready: Furquan Shaikh Original-Tested-by: Furquan Shaikh Original-Reviewed-by: Patrick Georgi Original-Commit-Queue: Furquan Shaikh Reviewed-on: http://review.coreboot.org/10687 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- payloads/libpayload/drivers/udc/udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'payloads') 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; -- cgit v1.2.3