ANDROID: usb: gadget: fix MTP OS desc support
Upstream commit 1ae1602d ("configfs: switch ->default groups to a linked list") replaced the current config groups with a linked list. Hence we no longer need to kfree the groups. Also the initialization for default_groups now happens in the function config_group_init() which is called by config_group_init_type_name(). If we call usb_os_desc_prepare_interf_dir() prior to this initialization the kernel crashes when we create MTP function i.e when it reaches configfs_add_default_group(&d->group, os_desc_group) which is accessing uninitialized data. Fix this crash by moving usb_os_desc_prepare_interf_dir() to after the call to config_group_init_type_name(). Fixes: AOSP Change-ID: I9397072ca3d183efbc9571c6cde3790f10d8851e ("ANDROID: usb: gadget: Add support for MTP OS desc") [MichaelS: Updated commit log for kernel crash] Signed-off-by:Michael Scott <michael.scott@linaro.org> Signed-off-by:
Amit Pundir <amit.pundir@linaro.org>
Loading
Please register or sign in to comment