]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: Add the gserial port checking in gs_start_tx()
authorBaolin Wang <baolin.wang@linaro.org>
Thu, 30 Jun 2016 09:10:23 +0000 (17:10 +0800)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 22 Aug 2016 07:45:13 +0000 (10:45 +0300)
commit6bd87b8fee2a7c2a854e228b359243b5483585ef
tree7ea39421c6430ff79c71e9e293861f585b5d2d1d
parent3b37013ffc95d3285ff5807f0069c5cf1fdbb39e
usb: gadget: Add the gserial port checking in gs_start_tx()

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: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/function/u_serial.c