USB: usb-serial: replace shutdown with disconnect, release
This patch (as1254) splits up the shutdown method of usb_serial_driver into a disconnect and a release method. The problem is that the usb-serial core was calling shutdown during disconnect handling, but drivers didn't expect it to be called until after all the open file references had been closed. The result was an oops when the close method tried to use memory that had been deallocated by shutdown. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Este commit está contenido en:

cometido por
Greg Kroah-Hartman

padre
c706ebdfc8
commit
f9c99bb8b3
@@ -878,7 +878,7 @@ static void pl2303_break_ctl(struct tty_struct *tty, int break_state)
|
||||
dbg("%s - error sending break = %d", __func__, result);
|
||||
}
|
||||
|
||||
static void pl2303_shutdown(struct usb_serial *serial)
|
||||
static void pl2303_release(struct usb_serial *serial)
|
||||
{
|
||||
int i;
|
||||
struct pl2303_private *priv;
|
||||
@@ -890,7 +890,6 @@ static void pl2303_shutdown(struct usb_serial *serial)
|
||||
if (priv) {
|
||||
pl2303_buf_free(priv->buf);
|
||||
kfree(priv);
|
||||
usb_set_serial_port_data(serial->port[i], NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1123,7 +1122,7 @@ static struct usb_serial_driver pl2303_device = {
|
||||
.write_room = pl2303_write_room,
|
||||
.chars_in_buffer = pl2303_chars_in_buffer,
|
||||
.attach = pl2303_startup,
|
||||
.shutdown = pl2303_shutdown,
|
||||
.release = pl2303_release,
|
||||
};
|
||||
|
||||
static int __init pl2303_init(void)
|
||||
|
Referencia en una nueva incidencia
Block a user