Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 8157e626 authored by Amit Pundir's avatar Amit Pundir
Browse files

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: default avatarMichael Scott <michael.scott@linaro.org>
Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
parent 8153b2c8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment