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

Skip to content
Commit 614aa86d authored by Hemant Kumar's avatar Hemant Kumar
Browse files

usb: gadget: f_gsi: Get rid of unneeded NULL check in gsi_ctrl_dev_write



c_port will always be allocated as long as gsi is allocated. struct gsi
is getting allocated before char device node is created. usb request and
usb request buffer pointers are not accessed in this function. It is
getting accessed in gsi_ctrl_send_notification() which has a check for
gsi->connected which will not be set until set_alt. Hence get rid of NULL
checks for all these pointers. This helps to reduce the window of use
after free in case write() gets called after driver unbind.

Change-Id: I05ee1d12c8c394a0f62407944eb5ff28092e3d39
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent dabca6e5
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