mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 01:10:04 +00:00
USB: keyspan: fix null-deref at probe
Fix null-pointer dereference during probe if the interface-status
completion handler is called before the individual ports have been set
up.
Fixes: f79b2d0fe8
("USB: keyspan: fix NULL-pointer dereferences and
memory leaks")
Reported-by: Richard <richjunk@pacbell.net>
Tested-by: Richard <richjunk@pacbell.net>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
This commit is contained in:
parent
90441b4dbe
commit
b5122236bb
1 changed files with 15 additions and 5 deletions
|
@ -410,6 +410,8 @@ static void usa26_instat_callback(struct urb *urb)
|
|||
}
|
||||
port = serial->port[msg->port];
|
||||
p_priv = usb_get_serial_port_data(port);
|
||||
if (!p_priv)
|
||||
goto resubmit;
|
||||
|
||||
/* Update handshaking pin state information */
|
||||
old_dcd_state = p_priv->dcd_state;
|
||||
|
@ -420,7 +422,7 @@ static void usa26_instat_callback(struct urb *urb)
|
|||
|
||||
if (old_dcd_state != p_priv->dcd_state)
|
||||
tty_port_tty_hangup(&port->port, true);
|
||||
|
||||
resubmit:
|
||||
/* Resubmit urb so we continue receiving */
|
||||
err = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
if (err != 0)
|
||||
|
@ -527,6 +529,8 @@ static void usa28_instat_callback(struct urb *urb)
|
|||
}
|
||||
port = serial->port[msg->port];
|
||||
p_priv = usb_get_serial_port_data(port);
|
||||
if (!p_priv)
|
||||
goto resubmit;
|
||||
|
||||
/* Update handshaking pin state information */
|
||||
old_dcd_state = p_priv->dcd_state;
|
||||
|
@ -537,7 +541,7 @@ static void usa28_instat_callback(struct urb *urb)
|
|||
|
||||
if (old_dcd_state != p_priv->dcd_state && old_dcd_state)
|
||||
tty_port_tty_hangup(&port->port, true);
|
||||
|
||||
resubmit:
|
||||
/* Resubmit urb so we continue receiving */
|
||||
err = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
if (err != 0)
|
||||
|
@ -607,6 +611,8 @@ static void usa49_instat_callback(struct urb *urb)
|
|||
}
|
||||
port = serial->port[msg->portNumber];
|
||||
p_priv = usb_get_serial_port_data(port);
|
||||
if (!p_priv)
|
||||
goto resubmit;
|
||||
|
||||
/* Update handshaking pin state information */
|
||||
old_dcd_state = p_priv->dcd_state;
|
||||
|
@ -617,7 +623,7 @@ static void usa49_instat_callback(struct urb *urb)
|
|||
|
||||
if (old_dcd_state != p_priv->dcd_state && old_dcd_state)
|
||||
tty_port_tty_hangup(&port->port, true);
|
||||
|
||||
resubmit:
|
||||
/* Resubmit urb so we continue receiving */
|
||||
err = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
if (err != 0)
|
||||
|
@ -855,6 +861,8 @@ static void usa90_instat_callback(struct urb *urb)
|
|||
|
||||
port = serial->port[0];
|
||||
p_priv = usb_get_serial_port_data(port);
|
||||
if (!p_priv)
|
||||
goto resubmit;
|
||||
|
||||
/* Update handshaking pin state information */
|
||||
old_dcd_state = p_priv->dcd_state;
|
||||
|
@ -865,7 +873,7 @@ static void usa90_instat_callback(struct urb *urb)
|
|||
|
||||
if (old_dcd_state != p_priv->dcd_state && old_dcd_state)
|
||||
tty_port_tty_hangup(&port->port, true);
|
||||
|
||||
resubmit:
|
||||
/* Resubmit urb so we continue receiving */
|
||||
err = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
if (err != 0)
|
||||
|
@ -926,6 +934,8 @@ static void usa67_instat_callback(struct urb *urb)
|
|||
|
||||
port = serial->port[msg->port];
|
||||
p_priv = usb_get_serial_port_data(port);
|
||||
if (!p_priv)
|
||||
goto resubmit;
|
||||
|
||||
/* Update handshaking pin state information */
|
||||
old_dcd_state = p_priv->dcd_state;
|
||||
|
@ -934,7 +944,7 @@ static void usa67_instat_callback(struct urb *urb)
|
|||
|
||||
if (old_dcd_state != p_priv->dcd_state && old_dcd_state)
|
||||
tty_port_tty_hangup(&port->port, true);
|
||||
|
||||
resubmit:
|
||||
/* Resubmit urb so we continue receiving */
|
||||
err = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
if (err != 0)
|
||||
|
|
Loading…
Reference in a new issue