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

Skip to content
Commit 79038b82 authored by Hemant Kumar's avatar Hemant Kumar Committed by Mayank Rana
Browse files

usb: f_gsi: Instantiate all gsi protocols upon module init



commit cc5d01e10248 ("usb: gadget: gsi: Defer freeing memory
on free_inst if in use") overwrite file pointer private data
in gsi_ctrl_dev_open(). If char device node gets re-opened
container_of in gsi_ctrl_dev_open() may result into unmapped memory
access. Since this commit is trying to fix use after free issue
therefore allocate all gsi protocol instances upon module init.
Update protocol id and create misc device node upon set_instance.
Also allocate one ipc_log context with NUM_LOG_PAGES as 15. Add
protocol id as part of the log in order to distinguishe different
protocol logging.

This change fixes warnings when enum usb_prot_id and enum
ipa_usb_teth_prot related assignment used.

warning: implicit conversion from enumeration type 'enum usb_prot_id'
to different enumeration type 'enum ipa_usb_teth_prot'
[-Wenum-conversion]

Change-Id: I784fb1e3a36b45e8cdca6747ec9fe9bae5a3f5ad
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 01e3405d
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