aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/serial/usb-serial.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index e3e3728e16e3..a3665659d13b 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -122,11 +122,9 @@ static void return_serial(struct usb_serial *serial)
122 if (serial == NULL) 122 if (serial == NULL)
123 return; 123 return;
124 124
125 spin_lock(&table_lock);
126 for (i = 0; i < serial->num_ports; ++i) { 125 for (i = 0; i < serial->num_ports; ++i) {
127 serial_table[serial->minor + i] = NULL; 126 serial_table[serial->minor + i] = NULL;
128 } 127 }
129 spin_unlock(&table_lock);
130} 128}
131 129
132static void destroy_serial(struct kref *kref) 130static void destroy_serial(struct kref *kref)
@@ -174,7 +172,9 @@ static void destroy_serial(struct kref *kref)
174 172
175void usb_serial_put(struct usb_serial *serial) 173void usb_serial_put(struct usb_serial *serial)
176{ 174{
175 spin_lock(&table_lock);
177 kref_put(&serial->kref, destroy_serial); 176 kref_put(&serial->kref, destroy_serial);
177 spin_unlock(&table_lock);
178} 178}
179 179
180/***************************************************************************** 180/*****************************************************************************