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:Hemant Kumar <hemantk@codeaurora.org> Signed-off-by:
Mayank Rana <mrana@codeaurora.org>
Loading
Please register or sign in to comment