diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2009-06-02 11:53:55 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:44:47 -0400 |
commit | f9c99bb8b3a1ec81af68d484a551307326c2e933 (patch) | |
tree | 9031ebe390ecd558d54ad484dde5ba66dcf823b7 /drivers/usb/serial/keyspan.h | |
parent | c706ebdfc8955b850e477255a8c0f93f9f14712d (diff) |
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>
Diffstat (limited to 'drivers/usb/serial/keyspan.h')
-rw-r--r-- | drivers/usb/serial/keyspan.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h index 0d4569b60768..3107ed15af64 100644 --- a/drivers/usb/serial/keyspan.h +++ b/drivers/usb/serial/keyspan.h | |||
@@ -41,7 +41,8 @@ static int keyspan_open (struct tty_struct *tty, | |||
41 | static void keyspan_close (struct usb_serial_port *port); | 41 | static void keyspan_close (struct usb_serial_port *port); |
42 | static void keyspan_dtr_rts (struct usb_serial_port *port, int on); | 42 | static void keyspan_dtr_rts (struct usb_serial_port *port, int on); |
43 | static int keyspan_startup (struct usb_serial *serial); | 43 | static int keyspan_startup (struct usb_serial *serial); |
44 | static void keyspan_shutdown (struct usb_serial *serial); | 44 | static void keyspan_disconnect (struct usb_serial *serial); |
45 | static void keyspan_release (struct usb_serial *serial); | ||
45 | static int keyspan_write_room (struct tty_struct *tty); | 46 | static int keyspan_write_room (struct tty_struct *tty); |
46 | 47 | ||
47 | static int keyspan_write (struct tty_struct *tty, | 48 | static int keyspan_write (struct tty_struct *tty, |
@@ -569,7 +570,8 @@ static struct usb_serial_driver keyspan_1port_device = { | |||
569 | .tiocmget = keyspan_tiocmget, | 570 | .tiocmget = keyspan_tiocmget, |
570 | .tiocmset = keyspan_tiocmset, | 571 | .tiocmset = keyspan_tiocmset, |
571 | .attach = keyspan_startup, | 572 | .attach = keyspan_startup, |
572 | .shutdown = keyspan_shutdown, | 573 | .disconnect = keyspan_disconnect, |
574 | .release = keyspan_release, | ||
573 | }; | 575 | }; |
574 | 576 | ||
575 | static struct usb_serial_driver keyspan_2port_device = { | 577 | static struct usb_serial_driver keyspan_2port_device = { |
@@ -590,7 +592,8 @@ static struct usb_serial_driver keyspan_2port_device = { | |||
590 | .tiocmget = keyspan_tiocmget, | 592 | .tiocmget = keyspan_tiocmget, |
591 | .tiocmset = keyspan_tiocmset, | 593 | .tiocmset = keyspan_tiocmset, |
592 | .attach = keyspan_startup, | 594 | .attach = keyspan_startup, |
593 | .shutdown = keyspan_shutdown, | 595 | .disconnect = keyspan_disconnect, |
596 | .release = keyspan_release, | ||
594 | }; | 597 | }; |
595 | 598 | ||
596 | static struct usb_serial_driver keyspan_4port_device = { | 599 | static struct usb_serial_driver keyspan_4port_device = { |
@@ -611,7 +614,8 @@ static struct usb_serial_driver keyspan_4port_device = { | |||
611 | .tiocmget = keyspan_tiocmget, | 614 | .tiocmget = keyspan_tiocmget, |
612 | .tiocmset = keyspan_tiocmset, | 615 | .tiocmset = keyspan_tiocmset, |
613 | .attach = keyspan_startup, | 616 | .attach = keyspan_startup, |
614 | .shutdown = keyspan_shutdown, | 617 | .disconnect = keyspan_disconnect, |
618 | .release = keyspan_release, | ||
615 | }; | 619 | }; |
616 | 620 | ||
617 | #endif | 621 | #endif |