]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
usb: gadget/function/f_fs string table fix for multiple languages
authorDean Anderson <dean@sensoray.com>
Wed, 17 Mar 2021 22:41:09 +0000 (15:41 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 19 May 2021 08:59:50 +0000 (10:59 +0200)
commitfce4f456dcea4b67bed2a4e18668247e9fd9e66f
treeae9fdbbd7b80eb748796933034fce3a74492b465
parente0e7cd2b5cc80481a6706c49c097c01ca81f4a2f
usb: gadget/function/f_fs string table fix for multiple languages

BugLink: https://bugs.launchpad.net/bugs/1928825
commit 55b74ce7d2ce0b0058f3e08cab185a0afacfe39e upstream.

Fixes bug with the handling of more than one language in
the string table in f_fs.c.
str_count was not reset for subsequent language codes.
str_count-- "rolls under" and processes u32 max strings on
the processing of the second language entry.
The existing bug can be reproduced by adding a second language table
to the structure "strings" in tools/usb/ffs-test.c.

Signed-off-by: Dean Anderson <dean@sensoray.com>
Link: https://lore.kernel.org/r/20210317224109.21534-1-dean@sensoray.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/usb/gadget/function/f_fs.c