From: Felipe Balbi Date: Wed, 22 Feb 2017 17:12:39 +0200 Subject: [U-Boot] [PATCH 1/3] usb: gadget: g_dnl: hold maximum string descriptor Message-ID: <20170222151241.21902-1-felipe.balbi@linux.intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de A USB String descriptor can be up to 255 characters long and it's not NULL terminated according to the USB spec. This means our MAX_STRING_SERIAL should be 256 (to cope with NULL terminator). Signed-off-by: Felipe Balbi --- No access to a board right now, compile tested only drivers/usb/gadget/g_dnl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c index 4ba7c1da7cb0..fcedb554c4c6 100644 --- a/drivers/usb/gadget/g_dnl.c +++ b/drivers/usb/gadget/g_dnl.c @@ -36,7 +36,7 @@ #define STRING_USBDOWN 2 /* Index of String serial */ #define STRING_SERIAL 3 -#define MAX_STRING_SERIAL 32 +#define MAX_STRING_SERIAL 256 /* Number of supported configurations */ #define CONFIGURATION_NUMBER 1 -- 2.11.0.295.gd7dffce1ce