|
@@ -1483,11 +1483,13 @@ static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev)
|
|
ffs->ep0req->context = ffs;
|
|
ffs->ep0req->context = ffs;
|
|
|
|
|
|
lang = ffs->stringtabs;
|
|
lang = ffs->stringtabs;
|
|
- for (lang = ffs->stringtabs; *lang; ++lang) {
|
|
|
|
- struct usb_string *str = (*lang)->strings;
|
|
|
|
- int id = first_id;
|
|
|
|
- for (; str->s; ++id, ++str)
|
|
|
|
- str->id = id;
|
|
|
|
|
|
+ if (lang) {
|
|
|
|
+ for (; *lang; ++lang) {
|
|
|
|
+ struct usb_string *str = (*lang)->strings;
|
|
|
|
+ int id = first_id;
|
|
|
|
+ for (; str->s; ++id, ++str)
|
|
|
|
+ str->id = id;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
ffs->gadget = cdev->gadget;
|
|
ffs->gadget = cdev->gadget;
|