Composite's handling of langid 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is it legal for a host to request a string descriptor with langid 0?

In trying to get Android's adb to work I discovered that the adb
daemon on the host was doing such a thing, and the adb gadget driver
wasn't returning a string descriptor because of course it didn't have
any strings matching langid 0. Patching the adb daemon to specify
0x0409 instead of 0 works, as does the following patch to composite.c
to only do the language check if langid is non-zero.

Which is the correct fix?

Matt

--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -556,7 +556,7 @@ static int lookup_string(

        while (*sp) {
                s = *sp++;
-               if (s->language != language)
+               if (language && s->language != language)
                        continue;
                value = usb_gadget_get_string(s, id, buf);
                if (value > 0)
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux