• Baolin Wang's avatar
    usb: gadget: Add the gserial port checking in gs_start_tx() · 511a36d2
    Baolin Wang authored
    When usb gadget is set gadget serial function, it will be crash in below
    situation.
    
    It will clean the 'port->port_usb' pointer in gserial_disconnect() function
    when usb link is inactive, but it will release lock for disabling the endpoints
    in this function. Druing the lock release period, it maybe complete one request
    to issue gs_write_complete()--->gs_start_tx() function, but the 'port->port_usb'
    pointer had been set NULL, thus it will be crash in gs_start_tx() function.
    
    This patch adds the 'port->port_usb' pointer checking in gs_start_tx() function
    to avoid this situation.
    Signed-off-by: default avatarBaolin Wang <baolin.wang@linaro.org>
    Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
    511a36d2
u_serial.c 38.5 KB