mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
usb: gadget: serial: fix oops when data rx'd after close
commit daa35bd956 upstream.
When the gadget serial device has no associated TTY, do not pass any
received data into the TTY layer for processing; simply drop it instead.
This prevents the TTY layer from calling back into the gadget serial
driver, which will then crash in e.g. gs_write_room() due to lack of
gadget serial device to TTY association (i.e. a NULL pointer dereference).
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -537,7 +537,7 @@ static void gs_rx_push(unsigned long _port)
|
||||
}
|
||||
|
||||
/* push data to (open) tty */
|
||||
if (req->actual) {
|
||||
if (req->actual && tty) {
|
||||
char *packet = req->buf;
|
||||
unsigned size = req->actual;
|
||||
unsigned n;
|
||||
|
||||
Reference in New Issue
Block a user