Skip to contentSkip to conversation

usb: acm gadget: Null termintate strings table

PATCH In review Graham Williams 2 participants 2 messages Aug 28, 2013 – Aug 30, 2013 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: acm gadget: Null termintate strings table

The gadget strings table should be null terminated. usb_gadget_get_string() loops through the table expecting a null at the end of the list.

---
 drivers/usb/gadget/f_acm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/gadget/f_acm.c +1 -0
index 4b7e33e..ab1065a 100644
@@ -285,6 +285,7 @@ static struct usb_string acm_string_defs[] = {
 	[ACM_CTRL_IDX].s = "CDC Abstract Control Model (ACM)",
 	[ACM_DATA_IDX].s = "CDC ACM Data",
 	[ACM_IAD_IDX ].s = "CDC Serial",
+	{  } /* end of list */
 };
 
 static struct usb_gadget_strings acm_string_table = {
Signature · 1 line
1.8.0.1
#1 lore raw
Quoted 5 lines · Graham Williams

The gadget strings table should be null terminated. usb_gadget_get_string() loops through the table expecting a null at the end of the list.

Yeah, this finally worked! :)

Thanks for sticking with it, much appreciated. I've now applied this.

greg k-h