diff options
author | Michal Nazarewicz <mina86@mina86.com> | 2014-06-17 17:47:41 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-09 11:18:24 -0700 |
commit | d4d3b27333ded534e1cab26a33b7e4f1163e8ff9 (patch) | |
tree | e7cfcdb23cc81a2bf1960f572abb58da66435a91 /drivers/net/wireless | |
parent | 28c5980b5494b8163d6cba5a5007b6ec7e63de66 (diff) |
usb: gadget: f_fs: fix NULL pointer dereference when there are no strings
commit f0688c8b81d2ea239c3fb0b848f623b579238d99 upstream.
If the descriptors do not need any strings and user space sends empty
set of strings, the ffs->stringtabs field remains NULL. Thus
*ffs->stringtabs in functionfs_bind leads to a NULL pointer
dereferenece.
The bug was introduced by commit [fd7c9a007f: “use usb_string_ids_n()”].
While at it, remove double initialisation of lang local variable in
that function.
ffs->strings_count does not need to be checked in any way since in
the above scenario it will remain zero and usb_string_ids_n() is
a no-operation when colled with 0 argument.
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/wireless')
0 files changed, 0 insertions, 0 deletions