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.c | |
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.c')
-rw-r--r-- | drivers/usb/serial/keyspan.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index f1195a98f316..2594b8743d3f 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c | |||
@@ -2689,7 +2689,7 @@ static int keyspan_startup(struct usb_serial *serial) | |||
2689 | return 0; | 2689 | return 0; |
2690 | } | 2690 | } |
2691 | 2691 | ||
2692 | static void keyspan_shutdown(struct usb_serial *serial) | 2692 | static void keyspan_disconnect(struct usb_serial *serial) |
2693 | { | 2693 | { |
2694 | int i, j; | 2694 | int i, j; |
2695 | struct usb_serial_port *port; | 2695 | struct usb_serial_port *port; |
@@ -2729,6 +2729,17 @@ static void keyspan_shutdown(struct usb_serial *serial) | |||
2729 | usb_free_urb(p_priv->out_urbs[j]); | 2729 | usb_free_urb(p_priv->out_urbs[j]); |
2730 | } | 2730 | } |
2731 | } | 2731 | } |
2732 | } | ||
2733 | |||
2734 | static void keyspan_release(struct usb_serial *serial) | ||
2735 | { | ||
2736 | int i; | ||
2737 | struct usb_serial_port *port; | ||
2738 | struct keyspan_serial_private *s_priv; | ||
2739 | |||
2740 | dbg("%s", __func__); | ||
2741 | |||
2742 | s_priv = usb_get_serial_data(serial); | ||
2732 | 2743 | ||
2733 | /* dbg("Freeing serial->private."); */ | 2744 | /* dbg("Freeing serial->private."); */ |
2734 | kfree(s_priv); | 2745 | kfree(s_priv); |