From: Michal Nazarewicz Date: Tue, 17 Jun 2014 15:47:41 +0000 (+0200) Subject: usb: gadget: f_fs: fix NULL pointer dereference when there are no strings X-Git-Tag: omap-for-v3.16/fixes-rc4~20^2~9^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0688c8b81d2ea239c3fb0b848f623b579238d99;p=pandora-kernel.git usb: gadget: f_fs: fix NULL pointer dereference when there are no strings 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. Cc: # v2.6.36+ Signed-off-by: Michal Nazarewicz Signed-off-by: Felipe Balbi --- Reading git-diff-tree failed