Michal Nazarewicz
4882c04833
usb: gadget: f_fs: fix NULL pointer dereference when there are no strings
...
commit f0688c8b81 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 >
2014-07-09 11:14:00 -07:00
..
2013-04-03 14:43:31 +03:00
2013-03-18 11:17:46 +02:00
2013-03-18 11:16:56 +02:00
2014-06-07 13:25:32 -07:00
2012-05-04 15:52:53 +03:00
2013-05-15 17:20:08 +03:00
2013-03-18 11:18:11 +02:00
2012-09-10 16:43:24 +03:00
2014-03-06 21:30:10 -08:00
2013-04-23 14:11:51 +03:00
2013-12-20 07:45:08 -08:00
2012-10-31 15:09:44 +02:00
2013-05-15 17:25:49 +03:00
2013-01-21 20:52:43 +02:00
2013-10-01 09:17:46 -07:00
2012-09-10 15:37:51 +03:00
2013-04-03 14:43:31 +03:00
2013-09-07 22:09:59 -07:00
2013-05-15 17:19:43 +03:00
2013-04-03 14:43:31 +03:00
2014-07-09 11:14:00 -07:00
2012-10-31 15:09:44 +02:00
2013-01-21 20:52:40 +02:00
2013-07-21 18:21:24 -07:00
2012-10-31 15:09:44 +02:00
2013-04-03 14:43:31 +03:00
2013-04-23 14:09:57 +03:00
2012-10-31 15:09:44 +02:00
2013-04-05 15:18:00 -07:00
2013-04-03 14:43:35 +03:00
2013-04-23 14:12:02 +03:00
2013-05-15 17:19:43 +03:00
2013-03-04 13:13:58 +02:00
2013-05-15 17:21:32 +03:00
2013-03-18 11:18:21 +02:00
2013-03-18 11:18:18 +02:00
2013-01-18 14:08:21 +02:00
2013-03-18 11:17:47 +02:00
2012-06-12 13:32:29 +03:00
2013-05-05 00:16:11 -04:00
2013-01-18 14:08:21 +02:00
2013-01-21 20:52:46 +02:00
2013-05-15 17:25:19 +03:00
2013-04-02 16:57:24 +03:00
2013-04-05 15:18:00 -07:00
2013-01-21 20:52:40 +02:00
2012-09-10 16:43:24 +03:00
2013-01-10 12:38:52 +02:00
2013-05-05 00:16:11 -04:00
2013-03-18 11:16:45 +02:00
2012-11-21 13:27:17 -08:00
2013-05-15 17:21:52 +03:00
2014-06-30 20:09:41 -07:00
2013-05-15 17:33:42 +03:00
2013-05-01 17:51:54 -07:00
2013-05-15 17:25:11 +03:00
2013-01-24 21:11:29 +02:00
2013-04-03 14:43:35 +03:00
2012-09-10 16:13:03 +03:00
2013-04-23 14:11:29 +03:00
2013-04-02 11:42:47 +03:00
2012-06-22 13:08:21 +03:00
2013-04-02 11:42:45 +03:00
2013-04-02 11:42:45 +03:00
2013-04-03 14:43:31 +03:00
2012-05-12 15:02:22 -04:00
2013-04-05 15:18:00 -07:00
2013-04-05 15:18:00 -07:00
2013-04-03 21:02:47 +03:00
2013-03-18 11:17:53 +02:00
2012-05-04 15:52:57 +03:00
2013-03-27 13:18:59 +02:00
2013-02-22 23:31:31 -05:00
2013-05-15 17:22:06 +03:00
2013-01-24 21:11:31 +02:00
2013-04-02 17:13:40 +03:00
2013-01-24 21:11:31 +02:00
2013-05-15 17:25:00 +03:00
2012-07-30 17:25:12 -07:00
2013-04-09 14:13:32 -04:00
2012-05-12 15:02:22 -04:00
2013-05-15 17:24:39 +03:00
2013-01-24 21:11:32 +02:00
2013-05-15 17:33:09 +03:00
2012-05-04 15:53:17 +03:00
2013-03-18 11:18:10 +02:00
2013-04-03 14:43:36 +03:00
2013-02-26 20:16:07 -08:00
2014-05-06 07:55:30 -07:00
2012-09-10 16:13:00 +03:00
2013-04-03 14:43:31 +03:00
2013-04-03 14:43:31 +03:00
2013-03-14 12:47:53 +02:00
2013-04-03 14:43:20 +03:00
2013-03-04 13:16:45 +02:00
2013-08-04 16:51:14 +08:00
2012-09-10 16:13:03 +03:00
2013-09-26 17:18:12 -07:00
2013-04-02 11:42:48 +03:00
2013-04-02 11:42:49 +03:00
2013-04-02 11:42:48 +03:00
2013-03-18 11:18:21 +02:00
2013-01-10 12:38:52 +02:00
2014-05-06 07:55:30 -07:00