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/belkin_sa.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/belkin_sa.c')
-rw-r--r-- | drivers/usb/serial/belkin_sa.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c index 2bfd6dd85b5a..7033b031b443 100644 --- a/drivers/usb/serial/belkin_sa.c +++ b/drivers/usb/serial/belkin_sa.c | |||
@@ -90,7 +90,7 @@ static int debug; | |||
90 | 90 | ||
91 | /* function prototypes for a Belkin USB Serial Adapter F5U103 */ | 91 | /* function prototypes for a Belkin USB Serial Adapter F5U103 */ |
92 | static int belkin_sa_startup(struct usb_serial *serial); | 92 | static int belkin_sa_startup(struct usb_serial *serial); |
93 | static void belkin_sa_shutdown(struct usb_serial *serial); | 93 | static void belkin_sa_release(struct usb_serial *serial); |
94 | static int belkin_sa_open(struct tty_struct *tty, | 94 | static int belkin_sa_open(struct tty_struct *tty, |
95 | struct usb_serial_port *port, struct file *filp); | 95 | struct usb_serial_port *port, struct file *filp); |
96 | static void belkin_sa_close(struct usb_serial_port *port); | 96 | static void belkin_sa_close(struct usb_serial_port *port); |
@@ -142,7 +142,7 @@ static struct usb_serial_driver belkin_device = { | |||
142 | .tiocmget = belkin_sa_tiocmget, | 142 | .tiocmget = belkin_sa_tiocmget, |
143 | .tiocmset = belkin_sa_tiocmset, | 143 | .tiocmset = belkin_sa_tiocmset, |
144 | .attach = belkin_sa_startup, | 144 | .attach = belkin_sa_startup, |
145 | .shutdown = belkin_sa_shutdown, | 145 | .release = belkin_sa_release, |
146 | }; | 146 | }; |
147 | 147 | ||
148 | 148 | ||
@@ -197,14 +197,13 @@ static int belkin_sa_startup(struct usb_serial *serial) | |||
197 | } | 197 | } |
198 | 198 | ||
199 | 199 | ||
200 | static void belkin_sa_shutdown(struct usb_serial *serial) | 200 | static void belkin_sa_release(struct usb_serial *serial) |
201 | { | 201 | { |
202 | struct belkin_sa_private *priv; | 202 | struct belkin_sa_private *priv; |
203 | int i; | 203 | int i; |
204 | 204 | ||
205 | dbg("%s", __func__); | 205 | dbg("%s", __func__); |
206 | 206 | ||
207 | /* stop reads and writes on all ports */ | ||
208 | for (i = 0; i < serial->num_ports; ++i) { | 207 | for (i = 0; i < serial->num_ports; ++i) { |
209 | /* My special items, the standard routines free my urbs */ | 208 | /* My special items, the standard routines free my urbs */ |
210 | priv = usb_get_serial_port_data(serial->port[i]); | 209 | priv = usb_get_serial_port_data(serial->port[i]); |