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