mirror of https://gitee.com/openkylin/linux.git
USB: serial: kl5kusb105: fix memleak on open
Fix memory leak of control-message transfer buffer on successful open().
Fixes: 6774d5f532
("USB: serial: kl5kusb105: fix open error path")
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
This commit is contained in:
parent
bf193bfc12
commit
3f203f057e
|
@ -276,12 +276,12 @@ static int klsi_105_open(struct tty_struct *tty, struct usb_serial_port *port)
|
|||
priv->cfg.unknown2 = cfg->unknown2;
|
||||
spin_unlock_irqrestore(&priv->lock, flags);
|
||||
|
||||
kfree(cfg);
|
||||
|
||||
/* READ_ON and urb submission */
|
||||
rc = usb_serial_generic_open(tty, port);
|
||||
if (rc) {
|
||||
retval = rc;
|
||||
goto err_free_cfg;
|
||||
}
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
rc = usb_control_msg(port->serial->dev,
|
||||
usb_sndctrlpipe(port->serial->dev, 0),
|
||||
|
@ -324,8 +324,6 @@ static int klsi_105_open(struct tty_struct *tty, struct usb_serial_port *port)
|
|||
KLSI_TIMEOUT);
|
||||
err_generic_close:
|
||||
usb_serial_generic_close(port);
|
||||
err_free_cfg:
|
||||
kfree(cfg);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue