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>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
c706ebdfc8
commit
f9c99bb8b3
@@ -79,7 +79,6 @@ static int ipaq_open(struct tty_struct *tty,
|
||||
static void ipaq_close(struct usb_serial_port *port);
|
||||
static int ipaq_calc_num_ports(struct usb_serial *serial);
|
||||
static int ipaq_startup(struct usb_serial *serial);
|
||||
static void ipaq_shutdown(struct usb_serial *serial);
|
||||
static int ipaq_write(struct tty_struct *tty, struct usb_serial_port *port,
|
||||
const unsigned char *buf, int count);
|
||||
static int ipaq_write_bulk(struct usb_serial_port *port,
|
||||
@@ -576,7 +575,6 @@ static struct usb_serial_driver ipaq_device = {
|
||||
.close = ipaq_close,
|
||||
.attach = ipaq_startup,
|
||||
.calc_num_ports = ipaq_calc_num_ports,
|
||||
.shutdown = ipaq_shutdown,
|
||||
.write = ipaq_write,
|
||||
.write_room = ipaq_write_room,
|
||||
.chars_in_buffer = ipaq_chars_in_buffer,
|
||||
@@ -990,11 +988,6 @@ static int ipaq_startup(struct usb_serial *serial)
|
||||
return usb_reset_configuration(serial->dev);
|
||||
}
|
||||
|
||||
static void ipaq_shutdown(struct usb_serial *serial)
|
||||
{
|
||||
dbg("%s", __func__);
|
||||
}
|
||||
|
||||
static int __init ipaq_init(void)
|
||||
{
|
||||
int retval;
|
||||
|
Reference in New Issue
Block a user