patch "USB: serial: ch341: handle unbound port at reset_resume" added to usb-linus
Subsystems (3)
This is a note to let you know that I've just added the patch titled
USB: serial: ch341: handle unbound port at reset_resume
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
From 4d5ef53f75c22d28f490bcc5c771fcc610a9afa4 Mon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Fri, 17 Jan 2020 10:50:22 +0100
Subject: USB: serial: ch341: handle unbound port at reset_resume
Check for NULL port data in reset_resume() to avoid dereferencing a NULL pointer in case the port device isn't bound to a driver (e.g. after a failed control request at port probe).
--- drivers/usb/serial/ch341.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/usb/serial/ch341.c +5 -1
@@ -642,9 +642,13 @@ static int ch341_tiocmget(struct tty_struct *tty)static int ch341_reset_resume (struct usb_serial *serial) {struct usb_serial_port *port = serial->port[0 ]; -struct ch341_private *priv =usb_get_serial_port_data (port); +struct ch341_private *priv;int ret; + priv =usb_get_serial_port_data (port); +if (!priv) +return 0 ; +/* reconfigure ch341 serial port after bus-reset */ ch341_configure (serial->dev, priv);
Signature · 1 line
2.25.0